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
desc 'creates a new post prefixed with the current date' | |
task :post, :name, :title, :categories do |task, args| | |
File.open(File.join('_posts', Time.now.strftime("%Y-%m-%d-#{args[:name].split(' ').join('-')}.markdown")), 'w') do |file| | |
file << <<-DOC | |
--- | |
layout: post | |
title: "#{args[:title].downcase}" | |
date: #{Time.now.strftime("%Y-%m-%d-%H:%M:%S")} | |
categories: #{args[:categories].downcase} | |
--- |
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
# The wrong way to make a class level method private | |
class Foo | |
def self.bar | |
p "bar" | |
end | |
private | |
def self.baz |
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
function clogs() { | |
if [[ -d log ]]; then | |
echo 'cleaning logs' | |
: > log/*.log | |
else | |
echo 'logs dir not found' | |
fi | |
} |
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 Base | |
DEFAULT_PROC = -> () {} | |
def initialize(api_key, connection_class = External::Service, builder = -> (klass, key) { klass.new(key) }) | |
@api_key = api_key | |
@builder = builder | |
@connection_class = connection_class | |
end | |
def execute(&block) |
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
Customer.joins(subscriptions: :product).group(:email).select('GROUP_CONCAT(DISTINCT subscriptions.state SEPARATOR ":::") AS states, GROUP_CONCAT(DISTINCT products.name SEPARATOR ":::") AS product_names, first_name, last_name').last.states |
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
RSpec.configure do |c| | |
if c.respond_to?(:default_color=) | |
c.failure_color = :green | |
c.success_color = :green | |
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
var fs = require('fs'), | |
path = './bower_components/fontawesome/scss/_icons.scss', | |
regex = /\.#{\$fa-css-prefix}([-|\w]+):before/g, | |
match, | |
data; | |
ENV.APP.awesomeness = []; | |
data = fs.readFileSync(path, 'utf8'); | |
while(match = regex.exec(data)) { |
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
var EmberApp = require('ember-cli/lib/broccoli/ember-app'), | |
app = new EmberApp() | |
files = require('broccoli-static-compiler'), | |
trees = require('broccoli-merge-trees'); | |
var fonts = files('./bower_components/fontawesome/fonts', { | |
srcDir: '/', | |
files: ['*'], | |
destDir: '/fonts' | |
}); |
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
set nocompatible | |
set shell=/bin/bash | |
if filereadable(expand("~/.vimrc.bundles")) | |
source ~/.vimrc.bundles | |
endif | |
if (&t_Co > 2 || has("gui_running")) && !exists("syntax_on") | |
syntax on | |
endif |
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
$here = File.expand_path(File.dirname(__FILE__)) | |
$rails_root = "#{$here}/../.." | |
$logs = "#{$rails_root}/logs/" | |
$script = "#{$rails_root}/script/autotest" | |
namespace :autotest do | |
desc "start autotest background task" | |
task :start do |
OlderNewer