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
{ | |
"bold_folder_labels": false, | |
"caret_style": "wide", | |
"color_scheme": "Packages/Solarized/Solarized (dark).tmTheme", | |
"com.khiltd.abacus.debug": true, | |
"draw_white_space": "selection", | |
"fade_fold_buttons": true, | |
"find_selected_text": true, | |
"font_face": "Espresso Mono", | |
"font_size": 12.0, |
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
#config/recipes/bootstrap.rb | |
#capistrano recipe | |
namespace :bootstrap do | |
desc "Prepare the system to run Puppet. Requires root access (once)." | |
task :default do | |
set :user, 'root' # because we haven't provisioned any users yet | |
# install puppet standalone | |
run "wget http://apt.puppetlabs.com/puppetlabs-release-#{config['os_code_name']}.deb" | |
run "dpkg -i puppetlabs-release-#{config['os_code_name']}.deb" |
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
# ./script/bootstrap | |
#!/usr/bin/env ruby | |
require 'fileutils' | |
# Capture ctrl-c and exit with a message. | |
Signal.trap("SIGINT") do | |
puts ; puts "Buh bye".red | |
exit 1 | |
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
#! /usr/bin/ruby | |
# Check for Denial of Service and Unsafe Object Creation Vulnerability in JSON | |
# [CVE-2013-0269] | |
# | |
# Adapted from [Heroku's script](https://github.com/heroku/heroku-CVE-2013-0269) to work on generic Rails app. | |
# | |
# cd into application path, (where the Gemfile.lock is), | |
# then run this script or simply `ruby -e "$(curl -fsSL http://bit.ly/CVE-2013-0269)"`. |
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
$form = $("#edit_item"); | |
// Build the FormData object with some Rails-specific attributes | |
var formData = new FormData($form[0]); | |
formData.append('utf8','✓') | |
formData.append('_method', 'put'); // editing existing record | |
formData.append('authenticity_token', AUTH_TOKEN); | |
$.ajax({ |
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
#app/views/layouts/facebook.html.erb | |
<!DOCTYPE html> | |
<html xmlns:fb="http://www.facebook.com/2008/fbml" | |
xmlns:og="http://opengraphprotocol.org/schema/"> | |
<head> | |
<title><%= yield(:title) %></title> | |
<meta charset="UTF-8"> | |
<meta property="og:title" content="<%= yield :og_title %>"> | |
<meta property="og:type" content="article"> | |
<meta property="og:image" content="<%= yield :og_image %>"> |
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 | |
# Public: Add a bunch of default class names to your html body element. | |
# By default it adds the name of the application, the current | |
# controller and the action | |
# | |
# classes - Arbitrary class names that are appended. Can be an Array | |
# of Strings or Symbols, or a single String or | |
# Symbol (or any to_s responder). | |
# | |
# Examples |
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 :myapp do | |
namespace :mynamespace do | |
class MyProcessRunner | |
def self.basename | |
"task_name" | |
end | |
def self.socket | |
Rails.root.join("tmp", "sockets", "#{basename}.dtach") |
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
delay 1 | |
tell application "ScreenSaverEngine" to activate |
NewerOlder