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
=begin | |
- if we just add a field we need to | |
- avoid adding 'home away properties' to the SearchLocation table | |
file: app/models/search_location.rb |
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
--- | |
55e9bb414ebabf7667000022: | |
created_at: 2015-09-04 15:39:45.888000000 Z | |
updated_at: 2017-08-15 22:43:17.349000000 Z | |
55f193104ebabf6a5300000f: | |
created_at: 2015-09-10 14:26:24.925000000 Z | |
updated_at: 2015-09-10 14:28:02.648000000 Z | |
55f2d9f74ebabf47b6000013: | |
created_at: 2015-09-11 13:41:11.380000000 Z | |
updated_at: 2015-09-11 15:08:55.310000000 Z |
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 | |
require 'csv' | |
require 'pp' | |
require 'readline' | |
require 'fileutils' | |
require 'rubygems' | |
require 'main' |
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
module ApplicationHelper | |
# <%= sass_eval 'opacify($red, 0.6)' %> | |
def sass_eval(expr) | |
css = ::Sass.compile("#value { value: #{ expr }; }") # ".value {\n value: $sass_processed_arg; }\n" | |
css.split('value:', 2).last.split(';', 2).first.strip | |
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
config = Rails.application.config | |
default_precompile = config.assets.precompile | |
config.assets.precompile = [ | |
proc do |path| | |
if path =~ /bower_components/ | |
false | |
else | |
default_precompile.call(path) |
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
require 'tmpdir' | |
require 'securerandom' | |
class Assassin | |
def Assassin.ate(*args, &block) | |
new(*args, &block) | |
end | |
attr_accessor :parent_pid | |
attr_accessor :child_pid |
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
# when you really, really, really want to make sure your children get cleaned up you can generate a script | |
# that detaches and monitors *you*. if you disappear the assassin can ensure cleanup happens. even if | |
# you are 'kill -9d' or call 'exit!' | |
assassin = <<-__ | |
pid = #{ Process.pid } | |
4242.times do | |
begin | |
Process.kill(0, pid) |
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
# encoding: utf-8 | |
# | |
companies = Company.where(:locale => 'ko') | |
domains = Domain.where(:company_id.in => companies.map(&:id)) | |
domains.destroy_all | |
companies.destroy_all | |
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
<!-- | |
using ids is effectively just like using a GOTO statement in code - it pins | |
logic to jump to a pre-labeled and identified spot by unique label/id. this | |
lets you avoid needing to make a good design. | |
--> |
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
# mongoid style | |
# | |
module A | |
end | |
class B | |
include A | |
end |