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
module DependencyInjection | |
def inject(subject, *deps) | |
deps.each do |dep| | |
subject.send(:"#{dep}=", send(dep)) | |
end | |
subject | |
end | |
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
<?php | |
function is_protected_post( $post_id = NULL ) { | |
global $post; | |
if ( $post_id === NULL ) | |
$post_id = $post->ID; | |
foreach ( array(Memberful_Post_ACL::PRODUCT, Memberful_Post_ACL::SUBSCRIPTION) as $check ) { |
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
Resolving dependencies... [86/1812] | |
Using rake (10.1.0) | |
Using i18n (0.6.5) | |
Using minitest (4.7.5) | |
Using multi_json (1.7.9) | |
Using atomic (1.1.12) | |
Using thread_safe (0.1.2) | |
Using tzinfo (0.3.37) | |
Using activesupport (4.0.0) | |
Using builder (3.1.4) |
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 'resque' | |
require 'resque_scheduler' | |
require 'sidekiq' | |
ENV['REDIS_URL'] = ENV['REDISTOGO_URL'] if ENV['REDISTOGO_URL'] | |
delayed_jobs = Resque.delayed_queue_peek(0, 5000) | |
to_insert = delayed_jobs.inject([]) do |result, timestamp| | |
jobs_at_time = Resque.delayed_timestamp_peek(timestamp, 0, 50000).map do |hash| |
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
/** | |
Title: White Hacker News | |
URL: http://stylebot.me/styles/55 | |
Author: http://stylebot.me/users/vinodpillai | |
**/ | |
body { | |
background-color: fff; | |
} |
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/bash | |
# Make sure we're in the same folder as the vagrant file | |
SOURCE="${BASH_SOURCE[0]}" | |
DIR="$( dirname "$SOURCE" )" | |
while [ -h "$SOURCE" ] | |
do | |
SOURCE="$(readlink "$SOURCE")" | |
[[ $SOURCE != /* ]] && SOURCE="$DIR/$SOURCE" | |
DIR="$( cd -P "$( dirname "$SOURCE" )" && pwd )" |
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
ActiveSupport::Cache::Store.instrument = true | |
ActiveSupport::Notifications.subscribe do |name, start, finish, id, payload| | |
Rails.logger.debug(["notification:", name, start, finish, id, payload].join(" ")) | |
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
# .profile for bash users. | |
# Executed on all machines because we do not permit the use of /bin/bash | |
# as a user's login shell. Note, however, on Linux PCs, /bin/sh is the | |
# same as /bin/bash. | |
case $cputype in | |
linux*) | |
SHELL=/bin/bash | |
export SHELL |
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
# ~/.bashrc: executed by bash(1) for non-login shells. | |
# see /usr/share/doc/bash/examples/startup-files (in the package bash-doc) | |
# for examples | |
# If not running interactively, don't do anything | |
[ -z "$PS1" ] && return | |
# don't put duplicate lines in the history. See bash(1) for more options | |
# ... or force ignoredups and ignorespace | |
HISTCONTROL=ignoredups:ignorespace |
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
matt@matt-laptop:~$ tree /usr/share/php/PHPUnit/ | |
/usr/share/php/PHPUnit/ | |
├── Autoload.php | |
├── Extensions | |
│ ├── Database | |
│ │ ├── AbstractTester.php | |
│ │ ├── Constraint | |
│ │ │ ├── DataSetIsEqual.php | |
│ │ │ └── TableIsEqual.php | |
│ │ ├── DataSet |