Skip to content

Instantly share code, notes, and snippets.

@megalithic
megalithic / termception.scpt
Last active February 19, 2017 02:21
open a selected file in finder within a new tmux window within an iTerm2 (termception).. dump this into an automator doc and save it as an app:
set filename to POSIX path of input
set cmd to "cd `dirname " & filename & "`; vim " & filename
tell application "iTerm"
tell the current window
# Uncomment the next line if you want to create a new iTerm tab instead.
#create tab with default profile
tell the current session
tell application "iTerm" to activate
delay 1
1 name: "uspto"
2 windows:
3 - name: "services"
4 root: "~/projects/uspto/frontend/"
5 layout: tiled
6 panes:
7 - echo "1"
8 - echo "2"
9 - echo "3"
19 - name: "chats"

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:

@megalithic
megalithic / gist:6198734
Created August 10, 2013 02:13
command WON'T run from within vim using vim's command line input, but WILL run from a zsh prompt
# the output of executing the command below, if i execute `karma run` from a zsh prompt, it runs just fine.. thoughts on how to fix?
:!karma run
zsh:1: command not found: karma
shell returned 127
Press ENTER or type command to continue
@megalithic
megalithic / gist:4942080
Last active December 13, 2015 16:39
attempt at highlighting debugger type of terms on write/read; specifically for js and rb files for now.
highlight javascriptDebugger guifg=white guibg=red ctermfg=white ctermbg=red
syntax match javascriptDebugger /debugger/
@megalithic
megalithic / stuff
Created February 7, 2013 16:25
i think we just need to wrap it in a document.ready basic.
$(function() {
$(".prep-select").html('<%= select_tag("recipe_ingredients[#{@recipe_ingredient.id}][prep_action_id]", options_from_collection_for_select(@preps, :id, :name, @recipe_ingredient.prep_action_id), {include_blank: true, prompt: 'Select Prep Action', class: 'chzn'}).gsub(/n/, '') %>');
$(".prep-select").append("<option value=''> Select a Prep Option </option>");
});

Using bitlbee with HipChat

Initial setup

  • account add jabber USERNAME@chat.hipchat.com 'PASSWORD'
  • account hipchat set nick_source full_name
  • account hipchat set resource bot
  • account hipchat on
@megalithic
megalithic / gist:4635510
Created January 25, 2013 15:58
output from `/key listdiff`
09:57 AM weechat | 4 key bindings added or redefined for context "default":
│09:57 AM weechat | ctrl-J => /buffer +1 (default command: /input return)
│09:57 AM weechat | ctrl-K => /buffer -1 (default command: /input delete_end_of_line)
│09:57 AM weechat | ctrl-h => /buffer -1
│09:57 AM weechat | ctrl-l => /buffer +1
│09:57 AM weechat |
│09:57 AM weechat | 4 key bindings deleted for context "default":
│09:57 AM weechat | ctrl-H => /input delete_previous_char
│09:57 AM weechat | ctrl-L => /window refresh
│09:57 AM weechat | ctrl-N => /buffer +1
@megalithic
megalithic / weechat.rb
Last active December 11, 2015 12:29
Updated weechat formula for homebrew
require 'formula'
class Weechat < Formula
homepage 'http://www.weechat.org'
url 'http://www.weechat.org/files/src/weechat-0.4.0.tar.bz2'
sha1 'e4b891d9d3d68196f97d226f487c4a2382d59d99'
depends_on 'cmake' => :build
depends_on 'gettext'
depends_on 'gnutls'
@megalithic
megalithic / vim.rb
Created October 26, 2012 03:17 — forked from mybeky/vim.rb
Vim formula for Homebrew with python, ruby and clipboard enabled
require 'formula'
class Vim < Formula
homepage 'http://www.vim.org/'
url 'https://vim.googlecode.com/hg/', :revision => '2d107086903a'
version '7.3.584'
def install
system "./configure",
"--with-features=huge",