Skip to content

Instantly share code, notes, and snippets.

@jteneycke
jteneycke / hamlize
Last active October 21, 2016 05:42
#!/usr/bin/env ruby
require "pry"
def command?(name)
`which #{name}`
$?.success?
end
htmls = `find . -type f -name \*.html`.split("\n")
@jteneycke
jteneycke / bootstrap-gallery-with-modal-and-carousel.markdown
Created November 16, 2016 02:50
Bootstrap Gallery with Modal and Carousel
" Window split settings
highlight TermCursor ctermfg=red guifg=red
set splitbelow
set splitright
" Terminal settings
tnoremap <Leader><ESC> <C-\><C-n>
" Window navigation function
" Make ctrl-h/j/k/l move between windows and auto-insert in terminals
@jteneycke
jteneycke / Gemfile
Created February 15, 2017 06:34 — forked from ejholmes/Gemfile
Sample Force.com Sinatra app.
source :rubygems
gem 'sinatra', '~> 1.3.3'
gem 'json', '~> 1.7.5'
gem 'restforce', '~> 1.0.5'
gem 'thin', '~> 1.5.0'
group :development do
gem 'shotgun', '~> 0.9'
gem 'tunnels', '~> 1.2.2'
@jteneycke
jteneycke / google_calendar_api_example.rb
Created February 25, 2017 05:57 — forked from bradymholt/google_calendar_api_example.rb
Google Calendar API with Ruby Client
#gem install 'google-api-client'
require 'google/api_client'
#Setup auth client
client_secrets = Google::APIClient::ClientSecrets.load #client_secrets.json must be present in current directory!
auth_client = client_secrets.to_authorization
auth_client.update!(
:scope => 'https://www.googleapis.com/auth/calendar',
:access_type => "offline", #will make refresh_token available
@jteneycke
jteneycke / ec
Created February 26, 2017 23:43 — forked from alexmurray/ec
Start Emacs Client in GUI (and launch Emacs server if not already running)
#!/bin/bash
# Shamelessly taken from http://mjwall.com/blog/2013/10/04/how-i-use-emacs/
# This script starts emacs daemon if it is not running, opens whatever file
# you pass in and changes the focus to emacs. Without any arguments, it just
# opens the current buffer or *scratch* if nothing else is open. The following
# example will open ~/.bashrc
# ec ~/.bashrc
@jteneycke
jteneycke / ec
Created February 26, 2017 23:43 — forked from alexmurray/ec
Start Emacs Client in GUI (and launch Emacs server if not already running)
#!/bin/bash
# Shamelessly taken from http://mjwall.com/blog/2013/10/04/how-i-use-emacs/
# This script starts emacs daemon if it is not running, opens whatever file
# you pass in and changes the focus to emacs. Without any arguments, it just
# opens the current buffer or *scratch* if nothing else is open. The following
# example will open ~/.bashrc
# ec ~/.bashrc
@jteneycke
jteneycke / vim_tmux_no_X_clipboard.vim
Created June 13, 2017 03:38 — forked from TroyFletcher/vim_tmux_no_X_clipboard.vim
Sharing clipboards between vim and tmux without xsel or xclip or X forwarding
" Share clipboards between vim and tmux without xsel or xclip (which require X and
" X forwarding with SSH) and without changing tmux shortcuts. Requires only tail.
"
" Great for an ssh session to you linode or droplet.
"
" Uses z buffer in vim and writes output to ~/.clipboard and then to tmux's paste
" buffer, and reads it back in cleanly for putting (puddin').
" Example vimrc mappings
" Visual mode yank selected area to tmux paste buffer (clipboard)
@jteneycke
jteneycke / tmux-all-panes.sh
Created June 15, 2017 01:34 — forked from acdvorak/tmux-all-panes.sh
tmux: run a command in all panes
#!/bin/bash
# Runs the specified command (provided by the first argument) in all tmux panes
# in every window. If an application is currently running in a given pane
# (e.g., vim), it is suspended and then resumed so the command can be run.
all-panes()
{
all-panes-bg_ "$1" &
}
@jteneycke
jteneycke / background.js
Created September 8, 2017 16:06 — forked from danharper/background.js
Bare minimum Chrome extension to inject a JS file into the given page when you click on the browser action icon. The script then inserts a new div into the DOM.
// this is the background code...
// listen for our browerAction to be clicked
chrome.browserAction.onClicked.addListener(function (tab) {
// for the current tab, inject the "inject.js" file & execute it
chrome.tabs.executeScript(tab.ib, {
file: 'inject.js'
});
});