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 | |
PLUGIN_NAME=$1 | |
PLUGIN_VERSION=$2 | |
if [ -z "$1" -o "$1" = "-h" ] | |
then | |
echo Usage: | |
echo List usage of a plugin: |
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 | |
def signature(str, key = nil) | |
key ||= CONFIG['facebook']['secret'] if defined?(CONFIG) | |
OpenSSL::HMAC.hexdigest(OpenSSL::Digest::Digest.new('sha1'), key, str) | |
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
require 'anemone' | |
require 'mongo' | |
# Patterns | |
POST_WITHOUT_SLASH = %r[\d{4}\/\d{2}\/[^\/]+$] # http://isbullsh.it/2012/66/here-is-a-title (301 redirects to slash) | |
POST_WITH_SLASH = %r[\d{4}\/\d{2}\/[\w-]+\/$] # http://isbullsh.it/2012/66/here-is-a-title/ | |
ANY_POST = Regexp.union POST_WITHOUT_SLASH, POST_WITH_SLASH | |
ANY_PAGE = %r[page\/\d+] # http://isbullsh.it/page/4 | |
ANY_PATTERN = Regexp.union ANY_PAGE, ANY_POST |
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
def cmd(c) | |
system c | |
end | |
namespace :tddium do | |
desc "post_build_hook" | |
task :post_build_hook do | |
# This build hook should only run after CI builds. | |
# | |
# There are other cases where we'd want to run something after every build, |
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
# | |
# This file configures the New Relic Agent. New Relic monitors | |
# Ruby, Java, .NET, PHP, and Python applications with deep visibility and low overhead. | |
# For more information, visit www.newrelic.com. | |
# | |
# Generated June 03, 2013 | |
# | |
# This configuration file is custom generated for Barsoom | |
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
#Deploy and rollback on Heroku in staging and production | |
%w[staging production].each do |app| | |
desc "Deploy to #{app}" | |
task "deploy:#{app}" => %W[deploy:set_#{app}_app deploy:push deploy:restart deploy:tag] | |
desc "Deploy #{app} with migrations" | |
task "deploy:#{app}:migrations" => %W[deploy:set_#{app}_app deploy:push deploy:off deploy:migrate deploy:restart deploy:on deploy:tag] | |
desc "Rollback staging" |
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.exports = function(grunt) { | |
grunt.initConfig({ | |
pkg: grunt.file.readJSON('package.json'), | |
manifest: grunt.file.readJSON('src/manifest.json'), | |
zip: { | |
extension: { | |
cwd: 'src/', | |
src: [ |
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 gulp = require('gulp'), | |
gutil = require('gulp-util'), | |
sass = require('gulp-sass'), | |
csso = require('gulp-csso'), | |
uglify = require('gulp-uglify'), | |
jade = require('gulp-jade'), | |
concat = require('gulp-concat'), | |
livereload = require('gulp-livereload'), // Livereload plugin needed: https://chrome.google.com/webstore/detail/livereload/jnihajbhpnppcggbcgedagnkighmdlei | |
tinylr = require('tiny-lr'), | |
express = require('express'), |
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
This document is outdated. | |
You should read David Bryant Copeland's excellent online book: http://angular-rails.com/crud_recipe.html | |
--------------------------------------------------------------------------------------------------------------- | |
I think it's better to install javascript/css libraries using Bower rather than gem which is Ruby packager. | |
1. Install Rails 4 and create a new project. | |
2. Install bower(Note you need to install node first.) | |
sudo npm install -g bower |
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 'rubygems' | |
require 'api_smith' | |
require 'date' | |
require 'ipaddr' | |
module GettinClickyWithIt | |
class Error < StandardError; end | |
SMART_NUMBER_TRANSFORMER = lambda { |v| Integer(v) rescue v } |
OlderNewer