Skip to content

Instantly share code, notes, and snippets.

@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 / 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 / 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'
" 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 / bootstrap-gallery-with-modal-and-carousel.markdown
Created November 16, 2016 02:50
Bootstrap Gallery with Modal and Carousel
@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 / Makefile
Created August 8, 2016 16:38 — forked from rtorr/Makefile
Watch elm files for changes and then recompile
js = $(shell echo $(elm) | tr A-Z a-z)
elm = Main
# Example: make elm=Main js=main watch
watch:
echo "watching *.elm files, outputing $(js).js" && fswatch -0 *.elm | xargs -0 -n 1 -I \{\} elm-make $(elm).elm --output $(js).js
# Example: make elm=Main js=main build
build:
elm-make $(elm).elm --output $(js).js
import Html exposing (..)
import Html.App exposing (..)
import Html.Attributes exposing (..)
import Html.Events exposing (..)
import Html.Attributes exposing (..)
import Http
import Task exposing (Task)
import Json.Decode as Json exposing ((:=))
type Msg
# jEdit :folding=explicit:collapseFolds=1:indentSize=2:tabSize=2:
# add requires here #{{{
#}}}
# handle command line #{{{
def usage #{{{
puts <<-USAGE