Skip to content

Instantly share code, notes, and snippets.

View sqlninja's full-sized avatar

John Henderson sqlninja

  • Henderson Holdings
  • Nashville, TN
View GitHub Profile
@wbotelhos
wbotelhos / clear-sidekiq-jobs.sh
Last active April 2, 2024 10:04
Clear Sidekiq Jobs
require 'sidekiq/api'
# 1. Clear retry set
Sidekiq::RetrySet.new.clear
# 2. Clear scheduled jobs
Sidekiq::ScheduledSet.new.clear
@randallreedjr
randallreedjr / heroku-remote.md
Last active April 25, 2024 07:06
Add a Heroku remote to an existing git repo

Working with git remotes on Heroku

Generally, you will add a git remote for your Heroku app during the Heroku app creation process, i.e. heroku create. However, if you are working on an existing app and want to add git remotes to enable manual deploys, the following commands may be useful.

Adding a new remote

Add a remote for your Staging app and deploy

Note that on Heroku, you must always use master as the destination branch on the remote. If you want to deploy a different branch, you can use the syntax local_branch:destination_branch seen below (in this example, we push the local staging branch to the master branch on heroku.

$ git remote add staging https://git.heroku.com/staging-app.git
@andypiper
andypiper / basic-recipes.md
Last active September 5, 2022 14:53
Twitter API recipes for twurl +jq, and other useful Twitter code snippets and tools
@mandiwise
mandiwise / Update remote repo
Last active May 2, 2024 08:59
Transfer repo from Bitbucket to Github
// Reference: http://www.blackdogfoundry.com/blog/moving-repository-from-bitbucket-to-github/
// See also: http://www.paulund.co.uk/change-url-of-git-repository
$ cd $HOME/Code/repo-directory
$ git remote rename origin bitbucket
$ git remote add origin https://github.com/mandiwise/awesome-new-repo.git
$ git push origin master
$ git remote rm bitbucket
@mlanett
mlanett / rails http status codes
Last active May 3, 2024 04:15
HTTP status code symbols for Rails
HTTP status code symbols for Rails
Thanks to Cody Fauser for this list of HTTP responce codes and their Ruby on Rails symbol mappings.
Status Code Symbol
1xx Informational
100 :continue
101 :switching_protocols
102 :processing
@staltz
staltz / introrx.md
Last active May 13, 2024 09:59
The introduction to Reactive Programming you've been missing
@mwhite
mwhite / git-aliases.md
Last active April 30, 2024 11:32
The Ultimate Git Alias Setup

The Ultimate Git Alias Setup

If you use git on the command-line, you'll eventually find yourself wanting aliases for your most commonly-used commands. It's incredibly useful to be able to explore your repos with only a few keystrokes that eventually get hardcoded into muscle memory.

Some people don't add aliases because they don't want to have to adjust to not having them on a remote server. Personally, I find that having aliases doesn't mean I that forget the underlying commands, and aliases provide such a massive improvement to my workflow that it would be crazy not to have them.

The simplest way to add an alias for a specific git command is to use a standard bash alias.

# .bashrc
@tedgrubb
tedgrubb / collection.json
Last active December 10, 2019 17:18
ActiveResource: Access to data and meta objects in JSON response.
{
"data": [
{"id": 7, "name": "Boston"},
{"id": 3, "name": "Chicago"},
{"id": 1, "name": "San Francisco"}
],
"meta": {
"errors": [],
"message": "",
"next": null,
@nz
nz / websolr.md
Created April 8, 2012 01:52
Websolr Heroku Devcenter

Websolr is a managed search service provided by Onemorecloud and powered by Apache Solr. The Websolr add-on allows you to use the high performance functionality of Solr in your application today.

Install the Add-on

:::term
$ heroku addons:add websolr

Choosing a Solr Client

The Apache Solr search server presents an API, and there are a number of open source clients to choose from. We recommend Sunspot, although you may already be using another. We provide more general client configuration at the end of this document.