Skip to content

Instantly share code, notes, and snippets.

View dinjas's full-sized avatar
:shipit:
Alive

Jason Dinsmore dinjas

:shipit:
Alive
  • Battle Ground, WA
View GitHub Profile
@dinjas
dinjas / keybase.md
Last active February 20, 2018 21:12

Keybase proof

I hereby claim:

  • I am dinjas on github.
  • I am dinjas (https://keybase.io/dinjas) on keybase.
  • I have a public key whose fingerprint is DB4C 13C4 E4BB 0C72 FC32 C65B E832 82FA 2A25 3CCF

To claim this, I am signing this object:

@dinjas
dinjas / .gitconfig
Created July 19, 2017 01:30 — forked from robmiller/.gitconfig
Some useful Git aliases that I use every day
#
# Working with branches
#
# Get the current branch name (not so useful in itself, but used in
# other aliases)
branch-name = "!git rev-parse --abbrev-ref HEAD"
# Push the current branch to the remote "origin", and set it to track
# the upstream branch
publish = "!git push -u origin $(git branch-name)"
@dinjas
dinjas / dot.powrc.sh
Created June 14, 2017 15:03 — forked from flarik/dot.powrc.sh
Pow's .porwrc config file for use with RVM's config files .rvmrc or .ruby-version (+ optional .ruby-gemset)
if [ -f "${rvm_path}/scripts/rvm" ]; then
source "${rvm_path}/scripts/rvm"
if [ -f ".rvmrc" ]; then
source ".rvmrc"
elif [ -f ".ruby-version" ] && [ -f ".ruby-gemset" ]; then
rvm use `cat .ruby-version`@`cat .ruby-gemset`
elif [ -f ".ruby-version" ]; then
rvm use `cat .ruby-version`
# From http://stackoverflow.com/a/13423584/153896
module ActiveRecord
class QueryCounter
attr_reader :query_count
def initialize
@query_count = 0
end
def to_proc
# Ways to execute a shell script in Ruby
# Example Script - Joseph Pecoraro
cmd = "echo 'hi'" # Sample string that can be used
# 1. Kernel#` - commonly called backticks - `cmd`
# This is like many other languages, including bash, PHP, and Perl
# Returns the result of the shell command
# Docs: http://ruby-doc.org/core/classes/Kernel.html#M001111
@dinjas
dinjas / stooge_loader.rb
Created January 24, 2017 21:28 — forked from bowsersenior/stooge_loader.rb
A demo of YAML anchors, references and nested values
require 'rubygems'
require 'yaml'
# A demonstration of YAML anchors, references and handling of nested values
# For more info, see:
# http://atechie.net/2009/07/merging-hashes-in-yaml-conf-files/
stooges = YAML::load( File.read('stooges.yml') )
# => {
# "default" => {
@dinjas
dinjas / ad_spots.js
Created October 21, 2016 17:16
adspot js pre-coffee conversion
$(function() {
var $podcast_url, $preview_ele, createMediaElement, showError;
$preview_ele = $('[data-id="preview"]');
$podcast_url = $('[data-id="podcast_url"]');
/**
* Creates the mediaelement object
* @param {Boolean} silent Whether to auto play when mediaelement is created
*/
createMediaElement = function(silent) {
@dinjas
dinjas / export_repo_issues_to_csv.py
Created August 19, 2016 15:37 — forked from unbracketed/export_repo_issues_to_csv.py
Export Issues from Github repo to CSV (API v3)
"""
Exports Issues from a specified repository to a CSV file
Uses basic authentication (Github username + password) to retrieve Issues
from a repository that username has access to. Supports Github API v3.
"""
import csv
import requests
@dinjas
dinjas / vim_copy_lines.text
Created July 26, 2016 19:51
How to copy lines matching pattern in vim
qaq # clear register A
:g/pattern/y A # copy lines matching pattern to register A
:let @+ = @a # copy register A to clipboard
@dinjas
dinjas / README.md
Created March 28, 2016 02:15 — forked from sj26/README.md
Run MailCatcher in the background, always, on OS X

Place me.mailcatcher.plist into ~/Library/LaunchAgents, then run launchctl load ~/Library/LaunchAgents/me.mailcatcher.plist.

If you use pow, echo 1080 > ~/.pow/mailcatcher and go to http://mailcatcher.dev, otherwise use http://localhost:1080.

Currently pow doesn't seem to pass websockets through correctly. Looking into this.