Skip to content

Instantly share code, notes, and snippets.

🛠
Building neat products

Jeffrey Horn jrhorn424

🛠
Building neat products
Block or report user

Report or block jrhorn424

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@jrhorn424
jrhorn424 / .npmrc
Last active Jun 21, 2018
Sane .npmrc
View .npmrc
package-lock=true
cache=node_cache # add ./node-cache to .gitignore
save=true
save-exact=true
# save-prefix='~'
@jrhorn424
jrhorn424 / GIF-Screencast-OSX.md
Created Feb 26, 2017 — forked from dergachev/GIF-Screencast-OSX.md
OS X Screencast to animated GIF
View GIF-Screencast-OSX.md

OS X Screencast to animated GIF

This gist shows how to create a GIF screencast using only free OS X tools: QuickTime, ffmpeg, and gifsicle.

Screencapture GIF

Instructions

To capture the video (filesize: 19MB), using the free "QuickTime Player" application:

@jrhorn424
jrhorn424 / controllers.application.js
Created Nov 1, 2016
ownProperties in Ember Objects
View controllers.application.js
import Ember from 'ember';
const Person = Ember.Object.extend({
greeting: 'yo',
say (thing) {
return `${thing}`;
},
say2 (thing) {
@jrhorn424
jrhorn424 / Fastmail-commented.plist
Last active Feb 20, 2016
Fastmail keybindings for MailMate
View Fastmail-commented.plist
#####################################################################################################
### WARNING: not kept up to date. I don't know the format well, and comments were causing issues. ###
### See next file for up-to-date mappings. ###
#####################################################################################################
{
// Keybindings to emulate Fastmail shortcuts in MailMate
// From: http://fastmail.wikia.com/wiki/KeyboardShortcuts
// Created by Jeffrey Horn <hello@jrhorn.me>
// See: http://manual.mailmate-app.com/key_binding_selectors
View MMCustomKeyBindings.plist
{
n = "nextMessage:";
p = "previousMessage:";
j = "nextThread:";
k = "previousThread:";
o = "openMessages:";
"\n" = "openMessages:";
"\n" = "openMessages:";
y = "archive:";
m = "moveToMailbox:";
View Refactor1.rb
class Article < ActiveRecord::Base
def self.states(*states)
states.each do |state|
define_method "#{state}?" do
self.state == state
end
define_singleton_method "all_#{state}" do
where("state = ?", state)
View _readme.md

I use tmux splits (panes). Inside one of these panes there's a Vim process, and it has its own splits (windows).

In Vim I have key bindings C-h/j/k/l set to switch windows in the given direction. (Vim default mappings for windows switching are the same, but prefixed with C-W.) I'd like to use the same keystrokes for switching tmux panes.

An extra goal that I've solved with a dirty hack is to toggle between last active panes with C-\.

Here's how it should work:

View .env.development
# Check this into the features that have different schemas as you develop
# Before you merge to master you either comment this out or remove the file
export DATABASE_NAME=cool_story_bro
@jrhorn424
jrhorn424 / routes.rb
Created Nov 11, 2013
Goal: have semi-static pages with a crud interface at root of application.
View routes.rb
FormtasticBootstrap3::Application.routes.draw do
resources :pages, path: '/'
end
View Rails Console Actionmailer test.rb
# First, copy your settings over
ActionMailer::Base.smtp_settings = {
:address => "smtp.mandrillapp.com",
:port => 587,
:domain => "ices-experiments.org",
:user_name => Settings.mandrill_user,
:password => Settings.mandrill_password,
:authentication => "login"
}
You can’t perform that action at this time.