Skip to content

Instantly share code, notes, and snippets.

@likethesky
likethesky / elixirphoenix.bash
Last active Mar 22, 2019
Installing Elixir & the Phoenix framework with Homebrew on OS X
View elixirphoenix.bash
$ brew update && brew doctor # Repeat, until you've done *all* the Dr. has ordered!
$ brew install postgresql # You'll need postgres to do this... you may also need to 'initdb' as well. Google it.
$ brew install elixir
$ mix local.hex # Answer y to any Qs
$ createuser -d postgres # create the default 'postgres' user that Chris McCord seems to like -- I don't create mine w/a pw...
# Use the latest Phoenix from here: http://www.phoenixframework.org/docs/installation -- currently this is 1.0.3
# ** Answer y to any Qs **
$ mix archive.install https://github.com/phoenixframework/phoenix/releases/download/v1.0.3/phoenix_new-1.0.3.ez
@likethesky
likethesky / gist:9077812
Created Feb 18, 2014
rvm bug: doesn't use Gemfile 'ruby' line specifying JRuby correctly (w/install_on_use_flag=1)
View gist:9077812
$ rvm list
rvm rubies
jruby-1.7.10 [ x86_64 ]
jruby-1.7.2 [ x86_64 ]
jruby-1.7.3 [ x86_64 ]
jruby-1.7.4 [ x86_64 ]
jruby-1.7.6 [ x86_64 ]
jruby-1.7.8 [ x86_64 ]
View gist:7128824
def __setup
@@clients ||= SUPPORTED_SERVICES.inject({}) do |memo, service_name|
memo.merge({ service_name => __client(service_name) })
end
end
View gist:6143675
file:/Users/brad/.rvm/rubies/jruby-1.7.4/lib/jruby.jar!/jruby/java/core_ext/object.rb:73 warning: already initialized constant Set
Unable to load thrift_native extension. Defaulting to pure Ruby libraries.
ArgumentError: wrong number of arguments calling `initialize` (1 for 0)
new at org/jruby/java/proxies/JavaInterfaceTemplate.java:387
TimeWindowSize at /Users/brad/git/thrift-utils-gem/lib/thrift-client/gen-rb/scoring_types.rb:15
Product_service at /Users/brad/git/thrift-utils-gem/lib/thrift-client/gen-rb/scoring_types.rb:10
(root) at /Users/brad/git/thrift-utils-gem/lib/thrift-client/gen-rb/scoring_types.rb:9
require at org/jruby/RubyKernel.java:1054
(root) at /Users/brad/git/thrift-utils-gem/lib/thrift-client/gen-rb/product_types.rb:1
require at org/jruby/RubyKernel.java:1054
@likethesky
likethesky / gist:6117832
Created Jul 30, 2013
Compare local amended commit with gerrit commit (to see if you want to toss your local amend, perhaps)
View gist:6117832
# Grab a Gerrit "checkout" URL, substituting "git diff" for "git checkout" at the end of the URL, as in:
git fetch http://gerrit.yourcompany.com:8080/p/apps/wize refs/changes/19/18919/4 && git diff FETCH_HEAD
@likethesky
likethesky / lsof
Created Jul 25, 2013
Determine what's on a port
View lsof
lsof -i :<port number> e.g.,
$ lsof -i :3000
View gist:4580335
$ sudo ls -latr /private/var/folders/zz/zyxvpxvq6csfxvn_n0000000000000/Cleanup\ At\ Startup/PKInstallSandbox-tmp/Root/Library/Printers/hp/Utilities/HP\ Utility.app/Contents/Resources
total 0
drwxr-xr-x 3 root admin 102 Jan 11 10:47 ko.lproj
drwxr-xr-x 3 root admin 102 Jan 11 11:14 ..
drwxr-xr-x 3 root admin 102 Jan 11 11:14 .
# Which leads to:
$ sudo ls -latr /private/var/folders/zz/zyxvpxvq6csfxvn_n0000000000000/Cleanup\ At\ Startup/PKInstallSandbox-tmp/Root/Library/Printers/hp/Utilities/HP\ Utility.app/Contents/Resources/ko.lproj
total 0
@likethesky
likethesky / gist:4262178
Created Dec 11, 2012
addressable gem dependency not bundled
View gist:4262178
My bundle aliases:
b = bundle
be = b exec
bi = b install --path vendor
bu = b update
bil = bi --local
binit = bi && b package --all && echo "vendor/ruby" >> .gitignore
# Note: my comments are in [#square brackets like this]
@likethesky
likethesky / index.html.haml
Created Nov 5, 2012
Cantango Demo -- goes in public/index.html of cantango_demo
View index.html.haml
%h1 Welcome to the CanTango Demo
%td= link_to("Home", root_path)
%td= link_to("Sign in", new_user_session_path)
%td= link_to("Sign up", new_user_registration_path)
%td= link_to("Sign out", destroy_user_session_path, :method => :delete)
%td= link_to("User forgot password", new_user_password_path)
%br
%br
%td= link_to("Admin home", admin_dashboard_path)
@likethesky
likethesky / gist:3842609
Created Oct 5, 2012
Shutdown Ubuntu via terminal command
View gist:3842609

sudo shutdown -P now # completely shuts down and powers off machine (if hardware supports power off signal)

sudo shutdown now # shuts down, doesn't power off -- see http://askubuntu.com/a/73698/79523 for more details.

You can’t perform that action at this time.