Skip to content

Instantly share code, notes, and snippets.

View webcaetano's full-sized avatar
🦄
Working from home

Andre Caetano webcaetano

🦄
Working from home
View GitHub Profile
@webcaetano
webcaetano / SomeCoin.sol
Created August 6, 2018 19:30
Created using remix-ide: Realtime Ethereum Contract Compiler and Runtime. Load this file by pasting this gists URL or ID at https://remix.ethereum.org/#version=soljson-v0.4.24+commit.e67f0147.js&optimize=false&gist=
pragma solidity ^0.4.22;
contract Utils {
function Utils() public {
}
// function compareStrings (string a, string b) view returns (bool){
// return keccak256(a) == keccak256(b);
// }
@webcaetano
webcaetano / Utils.sol
Created August 6, 2018 14:15
Created using remix-ide: Realtime Ethereum Contract Compiler and Runtime. Load this file by pasting this gists URL or ID at https://remix.ethereum.org/#version=soljson-v0.4.24+commit.e67f0147.js&optimize=false&gist=
pragma solidity ^0.4.22;
contract Utils {
function Utils() public {
}
// function compareStrings (string a, string b) view returns (bool){
// return keccak256(a) == keccak256(b);
// }
@webcaetano
webcaetano / SomeCoin.sol
Created August 6, 2018 14:12
Created using remix-ide: Realtime Ethereum Contract Compiler and Runtime. Load this file by pasting this gists URL or ID at https://remix.ethereum.org/#version=soljson-v0.4.24+commit.e67f0147.js&optimize=false&gist=
pragma solidity ^0.4.22;
contract SafeMath {
function SafeMath() {
}
function safeAdd(uint256 _x, uint256 _y) internal returns (uint256) {
uint256 z = _x + _y;
assert(z >= _x);
return z;
@webcaetano
webcaetano / file.md
Created June 14, 2017 21:56
Split commit in multiple

git rebase -i will do it.

To split apart your most recent commit, first:

$ git reset HEAD~ Now commit the pieces individually in the usual way, producing as many commits as you need.

If it was farther back in the tree, then

$ git rebase -i HEAD~3

@webcaetano
webcaetano / file.md
Created June 14, 2017 21:55
Fix gulp-cli

Run

sudo rm /usr/local/bin/gulp
sudo rm -rf /usr/local/lib/node_modules/gulp
npm uninstall gulp -g
npm uninstall gulp-cli -g
npm cache clean
npm install gulp-cli -g
@webcaetano
webcaetano / markdown.md
Created April 20, 2017 00:01
Mac timelapse screencapture

while [ 1 ];do vardate=$(date +%d-%m-%Y_%H.%M.%S); screencapture -t jpg -x ~/Desktop/screencapture/$vardate.jpg; sleep 5; done

@webcaetano
webcaetano / file.md
Created March 7, 2017 22:13
ffmpeg video to timelapse
[
{ "keys": ["super+shift+q"], "command": "run_macro_file", "args": {"file": "res://Packages/Default/Delete Line.sublime-macro"} },
{ "keys": ["super+up"], "command": "toggle_word"},
{ "keys": ["super+down"], "command": "toggle_word"},
{ "keys": ["super+shift+1"], "command": "open_terminal_project_folder" },
{
"keys": ["super+shif+e"],
"command": "chain",
"args": {
"commands": [
[
{ "keys": ["super+shift+q"], "command": "run_macro_file", "args": {"file": "res://Packages/Default/Delete Line.sublime-macro"} },
{ "keys": ["super+up"], "command": "toggle_word"},
{ "keys": ["super+down"], "command": "toggle_word"},
{ "keys": ["super+shift+1"], "command": "open_terminal" },
{
"keys": ["super+f"],
"command": "chain",
"args": {
"commands": [