Techy Things

Upgrade Jasmine 1.3 to 2.4 0

Upgrade Jasmine 1.3 to 2.4

Quick upgrade with those Regexp replaces /createSpyObj/ => " jasmine.createSpyObj" /createSpy/ => "jasmine.createSpy" /\.andCallFake/ => ".and.callFake" /\.andReturn/ => ".and.returnValue" /\.andCallThrough/ => ".and.callThrough" /toNotMatch/ => "not.toMatch" /this.addMatchers/ => "jasmine.addMatchers" /\.calls\[0\]\./ => ".calls.first()" /\.calls\[(\d)\]\./ => ".calls.all()[$1]"...

Install Node.js on CentOS 6 or 7 0

Install Node.js on CentOS 6 or 7

Following https://nodejs.org/en/download/package-manager/ curl --silent --location https://rpm.nodesource.com/setup | sudo bash - ## Run `yum install -y nodejs` (as root) to install Node.js v0.10 and npm. You may also need development tools to build native addons:...

Upgrade Ruby 1.8 to 2.1 with ActiveRecord 4 0

Upgrade Ruby 1.8 to 2.1 with ActiveRecord 4

Old Forms were like this, but now they don't render! <% form_for @seller, :url => "/seller/create" do |f| %> New <%= form_for @seller, :url => "/seller/create" do |f| %> Old Partial render are also...

Google sign-in authentication in your webapp 0

Google sign-in authentication in your webapp

The Documentation https://developers.google.com/identity/sign-in/web/sign-in   The Catch Since it is javascript, anyone can inject code in your website via the debugger and send any email as received and simulate a positive signin from google authentication,...

Create a P7B certificates bundle 0

Create a P7B certificates bundle

P7B certificates file can contain one or more certificates and a revocation list. The difference with P12 (PKCS#12), P7B (PKCS#7) cannot contain private keys. To create a P7B file Assuming you have frank.pem and...

Create a DER encoded X509 certificate 0

Create a DER encoded X509 certificate

Two types of X509 certificates There are base64 encoded certificates which look like -----BEGIN CERTIFICATE----- MIIFcDCCA1gCAhAAMA0GCSqGSIb3DQEBCwUAMHExCzAJBgNVBAYTAkdCMRAwDgYD (...) lcH2kxKqa1CWUQGz3S9raNtesOI7jbO9d2HRVPPTPVTliHukS8tlBouq5tU6IFgH I61lVg== -----END CERTIFICATE----- Then there are DER encoded certificates which look like To convert base64 to...

String manipulations in Javascripts 0

String manipulations in Javascripts

String.indexOf() Return value: -1 if not found 0 or higher than 0 as the index of the position found Remove one part of a string Method 1: String.replace(//, ""); Method 2: var indexEnd =...