Tutorial by Examples: cer

module OmniConcern extend ActiveSupport::Concern def create auth_params = request.env["omniauth.auth"] provider = AuthenticationProvider.get_provider_name(auth_params.try(:provider)).first authentication = provider.user_authentications.where(uid: auth_params.uid).first...
module OmniauthAttributesConcern extend ActiveSupport::Concern module ClassMethods Add Methods here end end In this concern we can create methods for each social media to fetch and store attributes. def twitter params (params['info']['email'] = "dummy#{SecureRan...
function createGoogleDriveFileOfMimeType() { var content,fileName,newFile;//Declare variable names fileName = "Test File " + new Date().toString().slice(0,15);//Create a new file name with date on end content = "This is the file Content"; newFile = DriveApp.cre...
A common workflow for using Git LFS is to declare which files are intercepted through a rules-based system, just like .gitignore files. Much of time, wildcards are used to pick certain file-types to blanket track. e.g. git lfs track "*.psd" When a file matching the above pattern is adde...
In order to obtain a Google Maps API key for your certificate, you must provide the API console with the SH1-fingerprint of your debug/release keystore. You can obtain the keystore by using the JDK's keytool program as described here in the docs. Another approach is to obtain the fingerprint progr...
--- person_table: - &person001 fname: homer lname: simpson role: dad age: 33 - &person002 fname: marge lname: simpson role: mom age: 34 - &person003 fname: pe...
--- person_table: - &person001 fname: homer lname: simpson role: dad age: 33 - &person002 fname: marge lname: simpson role: mom age: 34 - &person003 fname: pe...
Overview Create a queue that we can send a message to. Oracle will notify our stored procedure that a message has been enqueued and should be worked. We'll also add some subprograms we can use in an emergency to stop messages from being deqeued, allow dequeuing again, and run a simple batch job t...
If we want to replace only the first occurrence in a line, we use sed as usual: $ cat example aaaaabbbbb aaaaaccccc aaaaaddddd $ sed 's/a/x/' example xaaaabbbbb xaaaaccccc xaaaaddddd But what if we want to replace all occurrences? We just add the g pattern flag at the end: $ sed 's/a/x/...
public class Producer { private static Random random = new Random((int)DateTime.UtcNow.Ticks); //produce the value that will be posted to buffer block public double Produce ( ) { var value = random.NextDouble(); Console.WriteLine($"Producing value: {value}...
var bufferBlock = new BufferBlock<int>(new DataflowBlockOptions { BoundedCapacity = 1000 }); var cancellationToken = new CancellationTokenSource(TimeSpan.FromSeconds(10)).Token; var producerTask = Task.Run(async () => { var random = new Random(); while (!cancellati...
Of course, the best way to detect mobile is for the hardware to notify you directly. Cordova PhoneGap exposes a 'deviceready' event, that you can add an event listener to. document.addEventListener('deviceready', function(){ Session.set('deviceready', true); }, false);
Set up some constants for the server and authentication information. Assuming LDAPv3, but it's easy enough to change that. // Authentication, and the name of the server. private const string LDAPUser = "cn=example:app:mygroup:accts,ou=Applications,dc=example,dc=com"; private readonly ch...
This example is about replacing a List element while ensuring that the replacement element is at the same position as the element that is replaced. This can be done using these methods: set(int index, T type) int indexOf(T type) Consider an ArrayList containing the elements "Program sta...
Starting with Java 8, you can use lambda expressions & predicates. Example: Use a lambda expressions & a predicate to get a certain value from a list. In this example every person will be printed out with the fact if they are 18 and older or not. Person Class: public class Person { p...
Some email clients (notably Windows Desktop Outlook) collapse tables with no content, even if there are dimensions or padding. To prevent these clients from collapsing the spacer table, you can add an invisible   that serves as content. Then zero out the character's font-size and line-heig...
Worse ViewController: // ... myMethod: function () { this.getView().lookup('myhappyfield').setValue(100); } //... View: //... items: [ { xtype: 'textfield', reference: 'myhappyfield' } ] //... Better ViewController: // ... myMethod: function () { ...
post-receive hooks can be used to automatically forward incoming pushes to another repository. $ cat .git/hooks/post-receive #!/bin/bash IFS=' ' while read local_ref local_sha remote_ref remote_sha do echo "$remote_ref" | egrep '^refs\/heads\/[A-Z]+-[0-9]+$' >/dev/null &am...
4.0 #requires -RunAsAdministrator After trying to run this script without admin privileges, you will see this error message .\script.ps1 : The script 'script.ps1' cannot be run because it contains a "#requires" statement for running as Administrator. The current Windows PowerShell s...
When signing personal scripts or when testing code signing it can be useful to create a self-signed code signing certificate. 5.0 Beginning with PowerShell 5.0 you can generate a self-signed code signing certificate by using the New-SelfSignedCertificate-cmdlet: New-SelfSignedCertificate -Friendl...

Page 2 of 4