Skip to content

Instantly share code, notes, and snippets.

View address_calculation.js
function buildCreate2Address(senderAddress, saltHex, bytecode) {
return web3.utils.toChecksumAddress(`0x${web3.utils.sha3(`0x${[
].map(x => x.replace(/0x/, ''))
gagarine /
Last active Nov 23, 2022
Howto Install clamav on OSX with brew

Howto Install clamav on OSX with brew

Note: on legacy intel system the path may be /usr/local/etc/clamav instead of /opt/homebrew/etc/clamav/

$ brew install clamav
$ cd /opt/homebrew/etc/clamav/
$ cp freshclam.conf.sample freshclam.conf
View gist:6249142
#created by @nthgergo
set :application, "APPLICATION_NAME"
set :scm, :git
set :repository, "GIT_URL"
set :user, "ec2-user"
set :ssh_options, { :forward_agent => true }
default_run_options[:pty] = true
set :use_sudo, false
set :branch, "master"
ndarville /
Last active Nov 6, 2022
Business models based on the compiled list at I find the link very hard to browse, so I made a simple version in Markdown instead.

Business Models


Models Examples
Display ads Yahoo!
Search ads Google
lukewpatterson / gist:4242707
Created Dec 9, 2012
squeezing private SSH key into .travis.yml file
View gist:4242707
Tricks to add encrypted private SSH key to .travis.yml file
To encrypt the private SSH key into the "-secure: xxxxx....." lines to place in the .travis.yml file, generate a deploy key then run: (to see what the encrypted data looks like, see an example here:
base64 --wrap=0 ~/.ssh/id_rsa > ~/.ssh/id_rsa_base64
ENCRYPTION_FILTER="echo \$(echo \"-\")\$(travis encrypt veewee-community/veewee-push \"\$FILE='\`cat $FILE\`'\" | grep secure:)"
split --bytes=100 --numeric-suffixes --suffix-length=2 --filter="$ENCRYPTION_FILTER" ~/.ssh/id_rsa_base64 id_rsa_
gordonbrander / ID.js
Last active Oct 26, 2022
ID - a unique ID/name generator for JavaScript
View ID.js
// Do not use. Use Symbol() instead.
nherment /
Created Feb 29, 2012
Backup and restore an Elastic search index (shamelessly copied from
# herein we backup our indexes! this script should run at like 6pm or something, after logstash
# rotates to a new ES index and theres no new data coming in to the old one. we grab metadatas,
# compress the data files, create a restore script, and push it all up to S3.
TODAY=`date +"%Y.%m.%d"`
INDEXNAME="logstash-$TODAY" # this had better match the index name in ES
BACKUPCMD="/usr/local/backupTools/s3cmd --config=/usr/local/backupTools/s3cfg put"
YEARMONTH=`date +"%Y-%m"`
jamesarosen / 04_jshint.rake
Created May 2, 2011
Javascript Loves CI: Jenkins + Jasmine + PhantomJS + JSHint
View 04_jshint.rake
namespace :jshint do
task :require do
sh "which jshint" do |ok, res|
fail 'Cannot find jshint on $PATH' unless ok
task :check => 'jshint:require' do
project_root = File.expand_path('../../', File.dirname(__FILE__))
config_file = File.join(project_root, 'config', 'jshint.json')
ded / domready.js
Created Feb 24, 2011
Smallest x-browser DOM Ready, ever
View domready.js
function r(f){/in/(document.readyState)?setTimeout(r,9,f):f()}