This file contains hidden or 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
#got this error in your Rubymine Test runner, and have to "spring stop" all the time? | |
#/Users/maxwell/.rvm/gems/ruby-2.1.2/gems/activesupport-4.1.6/lib/active_support/dependencies.rb:247:in `require': cannot load such file -- teamcity/spec/runner/formatter/teamcity/formatter (LoadError) | |
#!/usr/bin/env ruby | |
begin | |
load File.expand_path("../spring", __FILE__) | |
rescue LoadError | |
end | |
require 'bundler/setup' |
This file contains hidden or 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
import random, time, os | |
timestorun = 100 | |
string = "" | |
capson = 0 | |
def makemore(letter, freq): | |
global string | |
if random.random() < freq: | |
string = string + letter | |
makemore(letter, freq) |
This file contains hidden or 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
source 'https://rubygems.org' | |
ruby '2.0.0' | |
gem 'rails', '4.0.0' | |
gem 'rails_autolink' | |
gem 'protected_attributes' |
This file contains hidden or 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
filepicker.uploadFile(evt.target, function(data){ | |
var filename = data.url + '+' + data.data.filename | |
$("form input[name='photo[image_url]']").val(filename) | |
that.$("form").submit(); | |
}); |
This file contains hidden or 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 Story < ActiveRecord::Base | |
# make likes count whatever basic score you want. it would be the sum of up plus down votes, or use whatever cache counters you have and weight them accordingly. | |
#the magic time should just be a unix time right before people started making stuff, for us, its just 6 months before we started makr.io | |
def self.ranked | |
order("(ln( 1 + posts.likes_count) + (EXTRACT(EPOCH FROM created_at) - 1327654606)/9000) desc") | |
end | |
This file contains hidden or 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 page = new WebPage(), | |
address, output, div; | |
if (phantom.args.length < 2 || phantom.args.length > 4) { | |
console.log('Usage: rasterize.js URL filename div'); | |
phantom.exit(); | |
} | |
address = phantom.args[0]; | |
output = phantom.args[1]; |
This file contains hidden or 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
maxwell: silly question: would a static linux build reduce the phantomjs /bin + /lib file size? | |
[1:56pm] maxwell: I am trying to package different binaries into gems | |
[1:56pm] maxwell: for heroku, but it seems the linux version increases my slug size by 50megs | |
[2:20pm] kanzure: kenperkins: --web-security=no should be for XSS not local POSTs | |
[2:21pm] kanzure: maxwell: err don't you mean "would a dynamically linked library decrease the size?" because statically linked is almost always larger | |
[2:21pm] maxwell: yeah, that was my understanding as well | |
[2:21pm] maxwell: but looking at the mac bin and lib | |
[2:21pm] maxwell: its about 10mb | |
[2:21pm] maxwell: but for the linux bin and lib | |
[2:21pm] maxwell: its like 35 |
This file contains hidden or 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
describe ApplicationController do | |
controller do | |
def index | |
#do nothing other than filters | |
end | |
end | |
describe "#set_locale" do | |
it 'prefers a param passed to the page' |
This file contains hidden or 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
# Copyright (c) 2010-2011, Diaspora Inc. This file is | |
# licensed under the Affero General Public License version 3 or later. See | |
# the COPYRIGHT file. | |
defaults: &defaults | |
###################################################### | |
# Environment Configuration | |
###################################################### |
This file contains hidden or 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
vendor/bundle/ruby/1.9.1/gems/i18n-0.6.0/lib/i18n/backend/pluralization.rb:37:in `pluralize' | |
vendor/bundle/ruby/1.9.1/gems/i18n-0.6.0/lib/i18n/backend/base.rb:40:in `translate' | |
vendor/bundle/ruby/1.9.1/gems/i18n-inflector-2.6.6/lib/i18n-inflector/backend.rb:74:in `translate' | |
lib/i18n_interpolation_fallbacks.rb:10:in `block in translate' | |
lib/i18n_interpolation_fallbacks.rb:8:in `each' | |
lib/i18n_interpolation_fallbacks.rb:8:in `translate' | |
vendor/bundle/ruby/1.9.1/gems/i18n-0.6.0/lib/i18n/backend/fallbacks.rb:44:in `block (2 levels) in translate' | |
vendor/bundle/ruby/1.9.1/gems/i18n-0.6.0/lib/i18n/backend/fallbacks.rb:43:in `catch' | |
vendor/bundle/ruby/1.9.1/gems/i18n-0.6.0/lib/i18n/backend/fallbacks.rb:43:in `block in translate' | |
vendor/bundle/ruby/1.9.1/gems/i18n-0.6.0/lib/i18n/backend/fallbacks.rb:42:in `each' |
NewerOlder