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
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
#/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
/** | |
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
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
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
<?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
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
#!/usr/bin/env ruby | |
require "openssl" | |
require 'digest/sha2' | |
require 'base64' | |
# We use the AES 256 bit cipher-block chaining symetric encryption | |
alg = "AES-256-CBC" | |
# We want a 256 bit key symetric key based on some passphrase | |
digest = Digest::SHA256.new |
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 | |
// This will dump information about all plans the currently signed in member has access to | |
var_dump(memberful_wp_user_plans_subscribed_to(wp_get_current_user()->ID)); | |
// This will print all downloads the currently signed in member has access to, including those granted by a subscription | |
var_dump(memberful_wp_user_downloads( wp_get_current_user()->ID )); | |
// You can also pass the id of a specific user to get the plans for that specific user. E.g |