git clone git@github.com:New-Bamboo/mapit.git
cd mapit
git checkout which-care
https://pypi.python.org/pypi/setuptools#installation-instructions
class Picture < ApplicationRecord | |
belongs_to :employee , -> { left_joins(:picture).merge(Picture.of_employee) }, foreign_key: :imageable_id, inverse_of: :pictures | |
belongs_to :product , -> { left_joins(:product).merge(Picture.of_product) }, foreign_key: :imageable_id, inverse_of: :pictures | |
scope :of_employee, -> { where(imageable_type: "Employee") } | |
scope :of_product, -> { where(imegeable_type: "Product") } | |
end | |
class Employee < ApplicationRecord | |
has_many :pictures, -> { of_employee }, dependent: nil, foreign_key: :imageable_id, inverse_of: :employee | |
end |
#!/usr/bin/env ruby | |
require 'tempfile' | |
def get_methods(file_contents) | |
code_for_all_methods = file_contents.scan(/((\s+?)def .*?^\2end)/m) | |
code_for_all_methods.each_with_object({}) do |(code), hsh| | |
method_name = code[/def (?:self\.)?(\w+)/, 1] | |
hsh[method_name.to_s] = code | |
end |
npm WARN lifecycle The node binary used for scripts is /Users/iainbeeston/.nodenv/shims/node but npm is using /Users/iainbeeston/.nvm/versions/node/v8.15.0/bin/node itself. Use the `--scripts-prepend-node-path` option to include the path for the node binary npm was executed with. | |
> codecombat@1.0.0 webpack /Users/iainbeeston/dev/codecombat | |
> webpack "--watch" | |
Automatically using Development webpack config | |
Starting Webpack... | |
Webpack is watching the files… |
#!/usr/bin/env ruby | |
# | |
# Given some react components written as ES6 classes, this converts any event handler methods from "normal" | |
# class methods to be arrow functions, assigned to static variables in the class. That way the method is | |
# always bound to "this". | |
# | |
file_paths = ARGV |
#!/usr/bin/env ruby | |
# recursively find classes | |
starting_file, working_directory = *ARGV | |
throw 'Please specify the file that contains the base class and the source directory' unless starting_file && working_directory | |
def files_that_subclass(file_path, dir) | |
contents = File.read(file_path) |
ruby-install -p https://raw.github.com/skaes/rvm-patchsets/master/patches/ruby/2.0.0/p353/railsexpress/01-zero-broken-tests.patch -p https://raw.github.com/skaes/rvm-patchsets/master/patches/ruby/2.0.0/p353/railsexpress/02-railsexpress-gc.patch -p https://raw.github.com/skaes/rvm-patchsets/master/patches/ruby/2.0.0/p353/railsexpress/03-display-more-detailed-stack-trace.patch -p https://raw.github.com/skaes/rvm-patchsets/master/patches/ruby/2.0.0/p353/railsexpress/04-show-full-backtrace-on-stack-overflow.patch -p https://raw.github.com/skaes/rvm-patchsets/master/patches/ruby/2.0.0/p353/railsexpress/05-fix-missing-c-return-event.patch ruby 2.0.0-p353 |
### Keybase proof | |
I hereby claim: | |
* I am iainbeeston on github. | |
* I am iainbeeston (https://keybase.io/iainbeeston) on keybase. | |
* I have a public key whose fingerprint is BD22 1F09 7190 335D 4E95 8A76 EC60 2EFF 2326 F692 | |
To claim this, I am signing this object: |
git clone git@github.com:New-Bamboo/mapit.git
cd mapit
git checkout which-care
https://pypi.python.org/pypi/setuptools#installation-instructions
==> Downloading http://ftp.postgresql.org/pub/source/v9.1.4/postgresql-9.1.4.tar.bz2 | |
Already downloaded: /Library/Caches/Homebrew/postgresql-9.1.4.tar.bz2 | |
==> Patching | |
patching file src/pl/plpython/Makefile | |
==> ./configure --disable-debug --prefix=/Users/iain/.homebrew/Cellar/postgresql/9.1.4 --data | |
checking build system type... x86_64-apple-darwin12.0.0 | |
checking host system type... x86_64-apple-darwin12.0.0 | |
checking which template to use... darwin | |
checking whether to build with 64-bit integer date/time support... yes | |
checking whether NLS is wanted... no |
module ApplicationHelper | |
def signature(str, key = nil) | |
key ||= CONFIG['facebook']['secret'] if defined?(CONFIG) | |
OpenSSL::HMAC.hexdigest(OpenSSL::Digest::Digest.new('sha1'), key, str) | |
end | |
end |