Skip to content

Instantly share code, notes, and snippets.

View jrmyward's full-sized avatar

Jeremy Ward jrmyward

  • OC Digital, LLC
  • Idaho Falls, ID
View GitHub Profile

SHORTCUTS

Key/Command Description
Tab Auto-complete files and folder names
Ctrl + A Go to the beginning of the line you are currently typing on
Ctrl + E Go to the end of the line you are currently typing on
Ctrl + U Clear the line before the cursor
Ctrl + K Clear the line after the cursor
Ctrl + W Delete the word before the cursor
Ctrl + T Swap the last two characters before the cursor
@jrmyward
jrmyward / rails http status codes
Created April 13, 2016 23:27 — forked from mlanett/rails http status codes
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
@jrmyward
jrmyward / NativeAudio.m
Last active February 25, 2016 00:54
Allow a Cordova hybrid app "duck" other audio from third-party sources.
//
//
// NativeAudio.m
// NativeAudio
//
// Created by Sidney Bofah on 2014-06-26.
//
#import "NativeAudio.h"
#import <AVFoundation/AVAudioSession.h>
@jrmyward
jrmyward / do_boot2.sh
Last active August 29, 2015 14:24 — forked from leucos/do_boot2.sh
#!/bin/bash
#
# What is that
# ============
#
# This script will help you setting up your digital ocean
# infrastructure with Ansible v2.0+ and DO API v2
#
# Usually, when working with DO, one is supposed to use digital_ocean.py
# inventory file, and spin up instances in a playbook.
@jrmyward
jrmyward / crypto_service.rb
Created February 20, 2014 18:00
A simple cyrpto service to encrypt a random token with a private rsa key.
require 'openssl'
require 'base64'
class CryptoService
def initialize
end
def generate_key
Base64.encode64(_private_key.private_encrypt(token)).gsub(/\n/, '')
# Configure colors, if available.
if [ -x /usr/bin/tput ] && tput setaf 1 >&/dev/null; then
c_reset='\[\e[0m\]'
c_user='\[\e[0;32m\]'
c_path='\[\e[1;34m\]'
c_git_clean='\[\e[0;37m\]'
c_git_staged='\[\e[0;32m\]'
c_git_unstaged='\[\e[0;31m\]'
else
c_reset=

Sublime Text 2 – Useful Shortcuts (Mac OS X)

General

⌘T go to file
⌘⌃P go to project
⌘R go to methods
⌃G go to line
⌘KB toggle side bar
⌘⇧P command prompt

1. Clone your fork:

git clone [email protected]:YOUR-USERNAME/YOUR-FORKED-REPO.git

2. Add remote from original repository in your forked repository:

cd into/cloned/fork-repo
git remote add upstream git://github.com/ORIGINAL-DEV-USERNAME/REPO-YOU-FORKED-FROM.git
git fetch upstream
@jrmyward
jrmyward / README.md
Created December 6, 2012 00:47 — forked from leemeichin/README.md
Apply Standard Competition Rankings to your leaderboard

Standard Competition Rankings

This class makes it easier to generate a leaderboard that complies with the Standard Competition Ranking system. That is, it takes joint/tied positions into account, and adjusts the positions accordingly.

Take the following list of users and points for example:

User    | Points
1         35
2         35