Skip to content

Instantly share code, notes, and snippets.

@ssoriche
ssoriche / gist:f1392dfddb5992376f8107cc5b615786
Created May 4, 2016 18:50 — forked from zolrath/gist:2305333
tmux status line from wemux example.

For a tmux status line as seen in the example image for the wemux project: wemux

The session on the left in the example screen shot uses a patched font from the vim-powerline project. Inconsolata-dz, you beautiful creature.

To duplicate the left status line add the following lines to your ~/tmux.conf

set -g status-left-length 32
set -g status-right-length 150
@ssoriche
ssoriche / git-branchdate
Created March 8, 2016 22:22
Same output as git branch -v but includes the date and time of the latest commit
#!/bin/bash
saveIFS=$IFS
IFS=$(printf "\n\b")
for i in $(git branch -v | cut -d " " -f 2- ); do
shopt -s extglob
branch="${branch##*( )}"
i="${i##*( )}"
shopt -u extglob
@ssoriche
ssoriche / ffmpeg-2.8-defaultstreams.patch
Created December 14, 2015 22:41
Patch for FFMPEG to fix broken channel disabling behavior
diff -d -E -b -w -r -i -r -c ffmpeg-2.8.orig/libavformat/movenc.c ffmpeg-2.8/libavformat/movenc.c
*** ffmpeg-2.8.orig/libavformat/movenc.c 2015-09-08 21:17:47.000000000 -0400
--- ffmpeg-2.8/libavformat/movenc.c 2015-09-10 14:37:43.000000000 -0400
***************
*** 4831,4853 ****
st->codec->codec_type >= AVMEDIA_TYPE_NB)
continue;
if (first[st->codec->codec_type] < 0)
first[st->codec->codec_type] = i;
@ssoriche
ssoriche / parsel.sql
Created November 9, 2015 14:53
Parsel: A Simple Function for Parallel Query in Postgres using Dblink
-- DROP FUNCTION IF EXISTS public.parsel(db text, table_to_chunk text, pkey text, query text, output_table text, table_to_chunk_alias text, num_chunks integer);
CREATE OR REPLACE FUNCTION public.parsel(db text, table_to_chunk text, pkey text, query text, output_table text, table_to_chunk_alias text default '', num_chunks integer default 2)
RETURNS text AS
$BODY$
DECLARE
sql TEXT;
min_id integer;
max_id integer;
step_size integer;
lbnd integer;
// Node.js CheatSheet.
// Download the Node.js source code or a pre-built installer for your platform, and start developing today.
// Download: http://nodejs.org/download/
// More: http://nodejs.org/api/all.html
// 0. Synopsis.
// http://nodejs.org/api/synopsis.html
#!/bin/bash
FILES=`git ls-tree --name-only HEAD .`
MAXLEN=0
for f in $FILES; do
if [ ${#f} -gt $MAXLEN ]; then
MAXLEN=${#f}
fi
done
for f in $FILES; do
javascript:str=window.location.hostname;n=str.split(".");l=n.length;op=window.prompt('Search in 1Password',n[(l-2)]+"."+n[(l-1)]);if(op!=null){window.location='onepassword://search/'+op;}

agnoster.zsh-theme

A ZSH theme optimized for people who use:

  • Solarized
  • Git
  • Unicode-compatible fonts and terminals (I use iTerm2 + Menlo)

For Mac users, I highly recommend iTerm 2 + Solarized Dark

<!-- Simple breadcrumbs for Rails -->
<!-- Example output -->
<!-- This example uses the Twitter Bootstrap classes for breadcrumbs -->
<!-- http://twitter.github.com/bootstrap/components.html#breadcrumbs -->
<% if breadcrumbs %>
<ul class="breadcrumb">
<% breadcrumbs.each do |crumb| %>
<li>
@ssoriche
ssoriche / gist:3759458
Created September 21, 2012 02:37 — forked from jeserkin/gist:1953801
Twitter Bootstrap Fluid-Sticky example. Modified martinbean example.
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Bootstrap, from Twitter</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="description" content="">
<meta name="author" content="">
<link href="../assets/css/bootstrap.css" rel="stylesheet">
<style type="text/css">