🧘♂️
This file contains 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
pragma solidity ^0.8.7; | |
// ---------------------------------------------------------------------------- | |
// ERC Token Standard #20 Interface | |
// | |
// ---------------------------------------------------------------------------- | |
abstract contract ERC20Interface { | |
function totalSupply() virtual public view returns (uint); | |
function balanceOf(address tokenOwner) virtual public view returns (uint balance); |
This file contains 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
var system = require('system'); | |
if (system.args.length < 5) { | |
console.info("You need to pass in account name, username, password, and path to casperJS as arguments to this code."); | |
phantom.exit(); | |
} | |
var account = system.args[1]; | |
var username = system.args[2]; | |
var password = system.args[3]; |
This file contains 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
# Gemfile | |
gem "puma" | |
# Procfile | |
web: bundle exec puma -p $PORT -e $RACK_ENV -C config/puma.rb | |
# add to config block config/environments/production.rb | |
config.threadsafe! | |
# get rid of NewRelic after_fork code, if you were doing this: |
This file contains 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
#!/usr/bin/env ruby | |
# STAQ threading & forking training 4/26/16 | |
# | |
# Invoke like so: | |
# | |
# ruby forking_and_threading.rb | |
# ruby forking_and_threading.rb thread | |
# ruby forking_and_threading.rb naive # seems to work OK | |
# env RBENV_VERSION=jruby-9.0.4.0 ruby ./forking_and_threading.rb naive # why does this give different results? | |
# |
This file contains 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
-- based on http://stackoverflow.com/questions/21767780/how-to-find-size-of-database-schema-table-in-redshift | |
SELECT name AS table_name, ROUND((COUNT(*) / 1024.0),2) as "Size in Gigabytes" | |
FROM stv_blocklist | |
INNER JOIN | |
(SELECT DISTINCT id, name FROM stv_tbl_perm) names | |
ON names.id = stv_blocklist.tbl | |
GROUP BY name | |
ORDER BY "Size in Gigabytes" DESC |
This file contains 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
alias a='ack' | |
alias a?='alias | grep -i' | |
alias adx='rake db:drop && rake db:create && heroku pg:transfer --from black --to postgres://postgres@localhost/staq_development --confirm staqweb --app staqweb && rails r "User.all.each { |u| u.update_attribute(:password,%q(password)) }" && rake db:test:prepare' | |
alias b='bundle' | |
alias bb='bundle install --binstubs=.bundle/bin --path=.bundle/gems && bundle package --all && reload ; sd' | |
alias bc='bin/console' | |
alias be='bundle exec' | |
alias bea='bundle exec annotate' | |
alias bu='bundle update' | |
alias bus='bundle update staq_extraction' |
This file contains 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
namespace :assets do | |
task :check do | |
root_dir = File.join(File.dirname(__FILE__),"..","..") | |
assets_last_modified_at = Dir["#{root_dir}/app/assets/**/**"].map { |p| File.mtime(p) }.sort.last | |
assets_last_compiled_at = Dir["#{root_dir}/public/assets/**/**"].map { |p| File.mtime(p) }.sort.last | |
if assets_last_modified_at > assets_last_compiled_at | |
fail "Assets need to precompiled; last asset modified at #{assets_last_modified_at}" | |
end | |
end |
This file contains 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
# makes Rails logs appear in the console, useful for seeing the actual SQL query generated from an AR find for example | |
# put this in ~/.railsrc | |
require 'logger' | |
Rails.logger = Logger.new STDOUT |
This file contains 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
# There's not much documentation about nifi's JRuby API but it closely follows | |
# what the python API looks like: | |
# see http://funnifi.blogspot.com/2016/02/executescript-processor-hello-world.html | |
flow_file = session.get() | |
updated_flow_file = session.putAttribute(flow_file,"my-attribute","my-value") | |
session.transfer(updated_flow_file,REL_SUCCESS) |
This file contains 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
# http://stackoverflow.com/questions/1960799/using-gitdropbox-together-effectively/1961515#1961515 | |
export REPONAME=???? | |
take ~/Dropbox/git/$REPONAME.git | |
git init --bare | |
cd ~/code/$REPONAME | |
git remote rm origin | |
git remote add origin ~/Dropbox/git/$REPONAME.git | |
git push -u origin master |
NewerOlder