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
function replaceProject(linkTarget) { | |
var area = $('#projectArea'); | |
area.animate({right: '100%'}, 500, function() { | |
area.load(linkTarget + ' ' + '#projectArea'); | |
area.animate({right: '0%'},1000, null); | |
urlSwap(linkTarget); | |
}); | |
} | |
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
def print_every_3_seconds num | |
5.times do | |
puts "Thread #{num}" | |
sleep 3 | |
end | |
puts "** DONE #{num} **" | |
end | |
(1..100).each do |num| | |
Thread.new do |
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
# in /tasks/scheduler.rake | |
desc "Called by Heroku cron add-on to stop spin down" | |
task :call_page => :environment do | |
uri = URI.parse('http://www.mikeholubowski.com/') | |
Net::HTTP.get(uri) | |
puts 'Pinged the site!' | |
end | |
# then use the heroku cron add-on to schedule it for every x minutes |
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
NotificationSubscription.where(confirmed: true) | |
.joins(property: :feedback_inputs) | |
.where("feedback_inputs.created_at >= :cutoff", {cutoff: 1.hour.ago}) |
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
# in gemfile | |
gem 'notifyIO' | |
# in config | |
notifier = NotifyIO::Notifier.new(auth_token: '12309jdsjLIJDwdsf') | |
# in controller or model | |
notifier.send do |n| | |
n.type = :alert |
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
# MPPerf Configuration File | |
# The host, URI (relative to the document root) and port to test. | |
host = NotifyIO-LB-972606977.us-east-1.elb.amazonaws.com | |
uri =/organizations/2 | |
port = 80 | |
# The 'rate' is the number of number of connections to open per second. | |
# A series of tests will be conducted, starting at low rate, | |
# increasing by rate sep, and finishing at high_rate. |
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
# Opens the github page for the current git repository in your browser | |
# [email protected]:jasonneylon/dotfiles.git | |
# https://github.com/jasonneylon/dotfiles/ | |
function gh() { | |
giturl=$(git config --get remote.origin.url) | |
if [ "$giturl" == "" ] | |
then | |
echo "Not a git repository or no remote.origin.url set" | |
exit 1; | |
fi |
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
# add to ~./bash_profile | |
if [ -f ~/.git-completion.bash ]; then | |
. ~/.git-completion.bash | |
fi | |
# create this file in `~/.git-completion.bash` | |
#!bash | |
# | |
# bash/zsh completion support for core Git. | |
# |
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
# The variable raw_name_data is set to the multiline | |
# string surrounded by 'datablock' | |
raw_name_data = <<-datablock | |
Name: Mike bullshit bullshit bullshit bullshit bullshit | |
Age: 13 bullshit bullshit bullshit bullshit bullshit | |
bullshit bullshit bullshit bullshit bullshit bullshit | |
bullshit bullshit bullshit bullshit bullshit bullshit | |
bullshit bullshit bullshit bullshit bullshit bullshit | |
bullshit bullshit bullshit Name: Nick Age: 22 bullshit | |
bullshit bullshit bullshit bullshit bullshit bullshit |
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 KeywordQueue | |
extend self | |
QUEUE_KEY = 'keyword-queue' | |
LOCK_KEY = 'keyword-queue:lock' | |
DELAY_TIME = 1 # Time in seconds between scrape batches | |
KW_FAILURES_KEY = 'keyword_queue:keyword_failures' | |
KW_FAILED_QUEUE_KEY = 'keyword_queue:failed_keywords' | |
KW_FAILURE_THRESHOLD = 5 |
OlderNewer