Skip to content

Instantly share code, notes, and snippets.

View jmoon90's full-sized avatar

John Moon jmoon90

  • New York, NY
View GitHub Profile
@jmoon90
jmoon90 / howto-setup-sidekiq-on-heroku.md
Created November 11, 2021 12:42 — forked from efrapp/howto-setup-sidekiq-on-heroku.md
Steps to setup Sidekiq on Heroku

Setup Sidekiq for Heroku

Install Heroku Redis Add-on

Option 1: Using the dashboard

Go to the Resources tab and in the Add-ons section type Heroku Redis in the search field. It will appear in the search list. Click on it and a modal will show up to install it, click in the Provision button to start the installation.

//= require jquery
//= require activestorage
//= require turbolinks
//= require rrt
//= require_tree .
Uncaught ReferenceError: ClipboardJS is not defined
def flatten_array(array, flattened=[])
array.each do |element|
if element.kind_of?(Array)
flatten_array(element, flattened)
else
flattened << element
end
end
flattened
end
AdWidget = {
settings: {
$window: $(window),
ad: $('#div-gpt-ad-boxad-0'),
},
init: function() {
s = this.settings;
viewTop = s.$window.scrollTop();
viewBottom = viewTop + s.$window.height();
@jmoon90
jmoon90 / git alias
Last active April 18, 2016 05:51
Git alias.
[alias]
copr = "!f() { git fetch -fu origin refs/pull/$1/head:pr-$1; git checkout pr-$1; } ; f"
prunepr = "!git for-each-ref refs/heads/pr-* --format='%(refname:short)' | while read ref ; do git branch -D $ref ; done"
tree = log --pretty=oneline --abbrev-commit --graph --decorate
# Instructions
# 1. add to .gitconfig
# 2. when pulling other people's branch you can use git copr 'pr number'
# e.g git copr 32 // this will pull down the branch
@jmoon90
jmoon90 / git alias
Created April 18, 2016 05:49
Git alias.
[alias]
copr = "!f() { git fetch -fu origin refs/pull/$1/head:pr-$1; git checkout pr-$1; } ; f"
prunepr = "!git for-each-ref refs/heads/pr-* --format='%(refname:short)' | while read ref ; do git branch -D $ref ; done"
tree = log --pretty=oneline --abbrev-commit --graph --decorate
def add_some
1+1 = 2
puts "added"
end
# renders
# { :json => 7 }
-(void)moveItemAtIndex:(NSUInteger)fromIndex
toIndex:(NSUInteger)toIndex
{
if(fromIndex == toIndex) {
return;
}
BNRItem *item = self.privateItems[fromIndex];
//Remove item from array
@number = 0
print "How much should we add:"
@number + gets.chomp.to_i
puts "> #{@number}"
print "How much should we subtract:"
@number - gets.chomp.to_i
puts "> #{@number}"
print "How much should we multiply:"
@number = gets.chomp.to_i * @number
puts "> #{@number}"