-
The new rake task assets:clean removes precompiled assets. [fxn]
-
Application and plugin generation run bundle install unless
--skip-gemfile
or--skip-bundle
. [fxn] -
Fixed database tasks for jdbc* adapters #jruby [Rashmi Yadav]
-
Template generation for jdbcpostgresql #jruby [Vishnu Atrai]
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
# Adds support for passing a :cache parameter to action definitions, eg: | |
# | |
# get '/state_map/?', :cache => 'state_map' do | |
# ... | |
# end | |
# | |
# :cache can also simply be passed true, in which case the route definition is used as the base | |
# key name. In all cases, any params are also included in the key. | |
# | |
# Author: ben tucker <ben@btucker.net> |
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 :db do | |
desc 'Open a MongoDB console with connection parameters for the current Rails.env' | |
task :console => :environment do | |
conn = Mongoid.master.connection | |
args = [] | |
args << "--username=#{conn.username}" if conn.username rescue nil | |
args << "--password=#{conn.password}" if conn.password rescue nil | |
args << "--host=#{conn.host}" | |
args << "--port=#{conn.port.to_s}" | |
args << Mongoid.master.name |
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
# -*- coding: utf-8 -*- | |
""" | |
codegen | |
~~~~~~~ | |
Extension to ast that allow ast -> python code generation. | |
:copyright: Copyright 2008 by Armin Ronacher. | |
:license: BSD. | |
""" |
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
// ==UserScript== | |
// @name Show Full Domain on Hacker News posts | |
// @description Sets full domain on hacker news posts. | |
// @namespace http://userscripts.org/users/119115 | |
// @include http://news.ycombinator.com/* | |
// @include https://news.ycombinator.com/* | |
// @match https://news.ycombinator.com/* | |
// @match http://news.ycombinator.com/* | |
// ==/UserScript== |
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
# Linear partition | |
# Partitions a sequence of non-negative integers into k ranges | |
# Based on Óscar López implementation in Python (http://stackoverflow.com/a/7942946) | |
# Also see http://www8.cs.umu.se/kurser/TDBAfl/VT06/algorithms/BOOK/BOOK2/NODE45.HTM | |
# Dependencies: UnderscoreJS (http://www.underscorejs.org) | |
# Example: linear_partition([9,2,6,3,8,5,8,1,7,3,4], 3) => [[9,2,6,3],[8,5,8],[1,7,3,4]] | |
linear_partition = (seq, k) => | |
n = seq.length | |
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
- (NSAttributedString *)loadContent { | |
NSString *filePath = [[NSBundle mainBundle] pathForResource:@"input" ofType:@"html"]; | |
NSData *htmlData = [NSData dataWithContentsOfFile:filePath]; | |
NSDictionary *options = @{ | |
NSDocumentTypeDocumentAttribute: NSHTMLTextDocumentType, | |
NSCharacterEncodingDocumentAttribute: @(NSUTF8StringEncoding) | |
}; | |
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
# .irbrc to log goodies like SQL/Mongo queries to $stdout if in Rails 3 console | |
if defined?(Rails) && Rails.respond_to?(:logger) | |
require 'logger' | |
Rails.logger = Logger.new($stdout) | |
if defined?(Mongoid) | |
Mongoid.logger = Rails.logger | |
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
""" | |
Get django-sekizai, django-compessor (and django-cms) playing nicely together | |
re: https://github.com/ojii/django-sekizai/issues/4 | |
using: https://github.com/jezdez/django_compressor.git | |
and: https://github.com/ojii/django-sekizai.git@0.5 | |
""" | |
from compressor.templatetags.compress import CompressorNode | |
from django.template.base import * | |
def compress(data, name): |
Install pyenv using homebrew:
$ brew install pyenv
Install multiple versions of python:
$ pyenv install 3.2.6 3.3.6 3.4.3
OlderNewer