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
if (!defined('WP_USE_THEMES')) { | |
define('WP_USE_THEMES', false); | |
require(dirname(__FILE__) . '/../../../../wp-config.php'); | |
} |
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
# constraint so sprockets /assets paths will not be caught by the assets controller | |
scope :constraints => lambda { |request| request[:controller] != 'assets' } do | |
match ':controller/:action.:format' => '#index' | |
match '/:controller(/:action(/:id))' | |
match ':controller/:action' => '#index' | |
match ':controller' => '#index' | |
end | |
# constraint so sprockets /assets paths will not be caught by assets/* URLs | |
scope :constraints => lambda { |request| !(request[:permalink] =~ /^assets\//) } do |
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
[alias] | |
rb = "!f() { git push origin master:$1 && git checkout -t origin/$1; }; f" |
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
class Thing | |
def self.build(data) | |
thing = new(data) | |
thing.valid? ? thing : nil | |
end | |
def initialize(data) | |
@url = data[:url] | |
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
# | |
# Recurring Job using Delayed::Job | |
# | |
# Setup Your job the "plain-old" DJ (perform) way, include this module | |
# and Your handler will re-schedule itself every time it succeeds. | |
# | |
# Sample : | |
# | |
# class MyJob | |
# include Delayed::ScheduledJob |
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
# config/locales/en.rb | |
{ | |
:en => { | |
:activerecord => { | |
:errors => { | |
:models => { | |
:bid => { | |
:price_too_low => lambda { |errors,attributes| | |
helpers = ActionController::Base.helpers | |
currency = attributes[:price] || 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
var marshalledForm = new MarshalledForm('#starting_xi_form'); | |
marshalledForm.add(':input', new MarshalledForm.Serializers.FormField()); | |
marshalledForm.add('img.player_image', new MarshalledForm.Serializers.Attribute("src")); | |
marshalledForm.add('span.name', new MarshalledForm.Serializers.HTML()); |
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
#!/usr/bin/ruby | |
# wol.rb: sends out a magic packet to wake up your PC | |
# | |
# Copyright (c) 2004 zunda <zunda at freeshell.org> | |
# Modified by scharfie <scharfie at gmail dot com> | |
# | |
# This program is free software. You can re-distribute and/or | |
# modify this program under the same terms of ruby itself --- | |
# Ruby Distribution License or GNU General Public License. | |
# |
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
pyRenamer - rename files | |
DragonDisk - S3 gui | |
Pithos - Pandora music player GUI | |
Shutter - screen capture | |
ClipIt - clipboard history | |
Pinta - image editor (sort of a lightweight PS) |
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
require 'rubygems' | |
require 'right_aws' | |
require 'yaml' | |
filename = ENV['FILE'].to_s | |
source = ENV['FROM'].to_s | |
destination = ENV['TO'].to_s | |
dry_run = true | |
puts "Please provide filename of s3 configuration" and exit(1) if filename == "" |