Skip to content

Instantly share code, notes, and snippets.

@thyforhtian
thyforhtian / snippy.sh
Created December 7, 2015 14:03 — forked from coderofsalvation/snippy.sh
modified version of snippy which features easier installation, follows symlinks, bashdown templates and automatic detection of cli vs window
#!/bin/bash
# video demo at: http://www.youtube.com/watch?v=90xoathBYfk
# written by "mhwombat": https://bbs.archlinux.org/viewtopic.php?id=71938&p=2
# Based on "snippy" by "sessy"
# (https://bbs.archlinux.org/viewtopic.php?id=71938)
#
# You will also need "dmenu", "xsel" and "xdotool". Get them from your linux
# distro in the usual way.
#
@thyforhtian
thyforhtian / gist:9c713200fc3c1eb38eb0
Last active August 26, 2015 07:37
Get user remote branches
for b in $(git branch -r | grep -v master | grep -v develop); do echo -n $b " "; git log -1 $b | grep Author; done | grep "User"
@thyforhtian
thyforhtian / .ansible.cfg
Created January 22, 2015 13:45
Ansible .ansible.cfg
[defaults]
transport = ssh
[ssh_connection]
ssh_args = -o ForwardAgent=yes
pipelining=True
@thyforhtian
thyforhtian / index.html
Created November 5, 2014 15:10
d3 - updating area chart
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Document</title>
<style>
body {
background: #f1f1f1;
}
@thyforhtian
thyforhtian / gist:a009c91093ea2c562638
Created October 27, 2014 15:13
stylus - generate simple responsive grid
el = 100%
columns = 12
gutter = 0.5%
for i in 1..columns
div.col-lg-{i}
width ((el/columns * i) - (gutter *2))
margin-left: gutter;
margin-right: gutter;
height: 30px;
@thyforhtian
thyforhtian / Vagrantfile
Created October 15, 2014 11:50
vagrant - ansible provision settings
config.vm.provision "ansible" do |ansible|
ansible.playbook = "playbook.yml"
ansible.inventory_path = "hosts"
ansible.limit = "all"
end
$max-width: 100%
$columns: 12
$gutter: 2%
$allgutters: $columns - 1
.row
width: 1024px
margin: 0 auto
@for $i from 1 through $columns
@thyforhtian
thyforhtian / custom.php
Created May 28, 2013 06:46
Wordpress: redirect to home after logout
add_filter('logout_url', 'projectivemotion_logout_home', 10, 2);
function projectivemotion_logout_home($logouturl, $redir) {
$redir = get_option('siteurl');
return $logouturl . '&amp;redirect_to=' . urlencode($redir);
}
@thyforhtian
thyforhtian / index.php
Created May 23, 2013 10:49
wordpress: add quicktags buttons
function add_well_buttons() {
?>
<script type="text/javascript">
QTags.addButton( 'blue_well', 'blue well', '<div class="well">', '</div>', 'blue well', 'Blue well', 300 );
QTags.addButton( 'orange_well', 'orange well', '<div class="well orange">', '</div>', 'orange well', 'Orange well', 300 );
</script>
<?php
}
add_action( 'admin_print_footer_scripts', 'add_well_buttons' );
@thyforhtian
thyforhtian / config.god
Last active December 12, 2015 08:39
Unicorn: monitoring with GOD
# http://unicorn.bogomips.org/SIGNALS.html
rails_env = ENV['RAILS_ENV'] || 'production'
rails_root = ENV['RAILS_ROOT'] || "/data/github/current"
God.watch do |w|
w.name = "unicorn"
w.interval = 30.seconds # default
# unicorn needs to be run from the rails root