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
# use watchr watchr.rb | |
require 'fileutils' | |
require 'growl' | |
$cache_dir = File.join('tmp', 'watchr') | |
FileUtils.mkdir_p($cache_dir) unless File.exist?($cache_dir) | |
def modified?(file) | |
cache_file = File.join $cache_dir, file |
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
hoursMins: (quarters) -> | |
addLeadingZero: (n) -> | |
if n.toString().length is 1 then "0$n" else "$n" | |
hours: addLeadingZero( Math.floor( quarters / 4)) | |
mins: addLeadingZero( quarters*15 - hours * 60) | |
"$hours:$mins" | |
addSlider: () -> | |
$("#slider-range").slider { | |
range: true, |
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
# Helper function to get rid of repeating bindTo calls | |
google.maps.MVCObject::bindProperties: (object, options) -> | |
for key, value of options | |
this.bindTo key, object, value | |
# Add listener for few events at a time. | |
# For example marker.addListener 'dragged', 'distance_changed', updateForm | |
google.maps.MVCObject::addListener: (events..., __func) -> | |
for event in events | |
google.maps.event.addListener this, event, (listener) => __func.call(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
Checking for program g++ or c++ : /usr/bin/g++ | |
Checking for program cpp : /usr/bin/cpp | |
Checking for program ar : /usr/bin/ar | |
Checking for program ranlib : /usr/bin/ranlib | |
Checking for g++ : ok | |
Checking for program gcc or cc : /usr/bin/gcc | |
Checking for gcc : ok | |
Checking for library dl : yes | |
Checking for library execinfo : not found | |
Checking for openssl : yes |
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
<html lang='en' xml:lang='en' xmlns='http://www.w3.org/1999/xhtml'> | |
<head> | |
<meta content='text/html;charset=UTF-8' http-equiv='content-type' /> | |
<script type="text/javascript" src="http://www.google.com/jsapi"></script> | |
<script type='text/javascript'> | |
google.load('visualization', '1', {'packages':['linechart']}); | |
</script> | |
<title>AGGRHHHH</title> | |
</head> | |
<body onload='drawVisualization()'> |
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
ArgumentError: wrong number of arguments (3 for 2) | |
from /Users/pro/.rvm/gems/ruby-1.9.2-p180/gems/mysql2-0.2.7/lib/active_record/connection_adapters/mysql2_adapter.rb:634:in `select' | |
from /Users/pro/.rvm/gems/ruby-1.9.2-p180/gems/activerecord-3.1.0.rc4/lib/active_record/connection_adapters/abstract/database_statements.rb:9:in `select_all' | |
from /Users/pro/.rvm/gems/ruby-1.9.2-p180/gems/activerecord-3.1.0.rc4/lib/active_record/connection_adapters/abstract/query_cache.rb:62:in `select_all' | |
from /Users/pro/.rvm/gems/ruby-1.9.2-p180/gems/activerecord-3.1.0.rc4/lib/active_record/base.rb:473:in `find_by_sql' | |
from /Users/pro/.rvm/gems/ruby-1.9.2-p180/gems/activerecord-3.1.0.rc4/lib/active_record/relation.rb:109:in `to_a' | |
from /Users/pro/.rvm/gems/ruby-1.9.2-p180/gems/activerecord-3.1.0.rc4/lib/active_record/relation/finder_methods.rb:155:in `all' | |
from /Users/pro/.rvm/gems/ruby-1.9.2-p180/gems/activerecord-3.1.0.rc4/lib/active_record/base.rb:444:in `all' | |
from (irb):1 | |
from /Users/pro/.rvm/gems/ruby-1.9.2-p180/ |
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 :resque do | |
task :setup => :environment do | |
Resque.before_fork { ActiveRecord::Base.connection.disconnect! } | |
Resque.after_fork { ActiveRecord::Base.establish_connection } | |
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
#!/bin/sh | |
#/ Usage: clean-merged-branches [-f] | |
#/ Delete merged branches from the origin remote. | |
#/ | |
#/ Options: | |
#/ -f Really delete the branches. Without this branches are shown | |
#/ but nothing is deleted. | |
set -e | |
# show usage maybe |
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 sh | |
## | |
# This is script with usefull tips taken from: | |
# https://github.com/mathiasbynens/dotfiles/blob/master/.osx | |
# | |
# install it: | |
# curl -sL https://raw.github.com/gist/2108403/hack.sh | sh | |
# |
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
class ActionDispatch::Routing::Mapper | |
def draw(routes_name) | |
instance_eval(File.read(Rails.root.join("config/routes", "#{@scope[:shallow_prefix]}", "#{routes_name}.rb"))) | |
end | |
end | |
BCX::Application.routes.draw do | |
draw :projects # => config/routes/projects.rb | |
namespace :admin do |
OlderNewer