git log --graph --all --decorate --pretty --oneline
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Setting up a kubernetes cluster on Virtual Box | |
## Server/Node setup | |
### Install ubuntu 16.04 | |
Login as root using | |
``` | |
sudo su - | |
``` |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
trigger ContactGuidGenerator on Contact (before insert) { | |
for( Contact c: Trigger.new ) { | |
final String chars = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789abcdefghijklmnopqrstuvwxyz'; | |
String guid = ''; | |
while (guid.length() < 16) { | |
Integer idx = Math.mod(Math.abs(Crypto.getRandomInteger()), chars.length()); | |
guid += chars.substring(idx, idx+1); | |
} | |
c.guid__c = guid; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
trigger ContactGuidGenerator on Contact (before insert) { | |
for( Contact c: Trigger.new ) { | |
Blob b = Crypto.GenerateAESKey(128); | |
String h = EncodingUtil.ConvertTohex(b); | |
String guid = h.SubString(0,8)+ h.SubString(8,12) + h.SubString(12,16) + h.SubString(16,20) + h.substring(20); | |
c.guid__c = guid; | |
// guid should be Text, size 32 | |
} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React from 'react'; | |
import ReactDOM from 'react-dom'; | |
import { mount } from 'enzyme' | |
import ReactTestUtils from 'react-addons-test-utils' | |
import * as api from './api'; | |
it('renders without crashing', () => { | |
api.sayHello = jest.fn() | |
api.sayHello.mockImplementation( (x) => "boom" ) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import sinonStubPromise from 'sinon-stub-promise'; | |
import sinon from 'sinon' | |
sinonStubPromise(sinon) | |
let stubedFetch = sinon.stub(window, 'fetch') ) | |
window.fetch.returns(Promise.resolve(mockApiResponse())); | |
function mockApiResponse(body = {}) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<build> | |
<plugins> | |
<plugin> | |
<groupId>org.apache.maven.plugins</groupId> | |
<artifactId>maven-compiler-plugin</artifactId> | |
<configuration> | |
<source>1.8</source> | |
<target>1.8</target> | |
</configuration> | |
</plugin> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function find_nested_prop( obj, propName, callback ) { | |
for( var key in obj ) { | |
var val = obj[key] | |
if ( key === propName ) { | |
callback(val, obj) | |
} | |
else if ( typeof val === 'object' ) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ruby -rwebrick -e'WEBrick::HTTPServer.new(:Port => 3000, :DocumentRoot => Dir.pwd).start' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
gem install capybara | |
gem install selenium-webkit | |
irb | |
Capybara.register_driver :selenium do |app| | |
Capybara::Selenium::Driver.new(app, :browser => :chrome) | |
end |
NewerOlder