This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//------------------------------------------------------------------------------ | |
// Remove class by Regex | |
// Array.filter for IE<9: https://gist.github.com/eliperelman/1031656 | |
[].filter||(Array.prototype.filter=function(a,b,c,d,e){c=this;d=[];for(e in c)~~e+''==e&&e>=0&&a.call(b,c[e],+e,c)&&d.push(c[e]);return d}); | |
// http://stackoverflow.com/a/18621161 | |
$.fn.removeClassRegex = function(regex) { | |
return $(this).removeClass(function(index, classes) { | |
return classes.split(/\s+/).filter(function(c) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
func httpRequestHandler(w http.ResponseWriter, req *http.Request) { | |
err := func () os.Error { | |
if req.Method != "GET" { | |
return os.NewError("expected GET") | |
} | |
if input := parseInput(req); input != "command" { | |
return os.NewError("malformed command") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
| |
import ( | |
"fmt" | |
"github.com/facebookgo/inject" | |
"strings" | |
) | |
| |
type ILog interface { | |
Log(string) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Install arch linux in an encrypted btrfs partition with GPT and UEFI support, gummiboot and hibernate/resume support | |
# sources: | |
# http://hole.tuziwo.info/install-arch-linux-on-uefi-gpt-computer-with-btrfs-support.html | |
# http://www.brunoparmentier.be/blog/how-to-install-arch-linux-on-an-encrypted-btrfs-partition.html | |
# https://wiki.archlinux.org/index.php/Dm-crypt/Swap_encryption | |
# Take note of this: | |
# - The first thing you need is to identify which disk you're going to use. For the purpose of this guide, it will be /dev/sdX | |
# Be VERY CAREFUL if you have more than one disk on your computer, and DOUBLE CAREFUL if one of them is the one with your backups | |
# - Since btrfs does not support swapfiles (yet), we'll create a swap partition. In this guide, it will NOT be encrypted |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# | |
# Marco Buzzanca © 2016. MIT License. | |
# Originarilly written by Tom Hale © 2016. MIT Licence. | |
# | |
# Print out 256 colors, with each number printed in its corresponding color. | |
# | |
# Compared to the original script this one also prints the first 16 colors in | |
# bright/bold, to check the interaction between bold and the ANSI colors. This | |
# script is also POSIX compliant. Unfortunately this meant I had to use |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Lines configured by zsh-newuser-install | |
HISTFILE=~/.histfile | |
HISTSIZE=1000 | |
SAVEHIST=1000 | |
setopt appendhistory autocd | |
unsetopt beep extendedglob nomatch notify | |
bindkey -v | |
# End of lines configured by zsh-newuser-install | |
# The following lines were added by compinstall (but then updated for speed) | |
zstyle :compinstall filename '/home/rfernandez/.zshrc' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- Get table sizes in Gigabytes sorted by size descending | |
SELECT name AS "table", substring(datname, 1, 15) AS "database", ROUND((COUNT(*) / 1024.0),2) AS "GB" | |
FROM stv_blocklist | |
INNER JOIN ( | |
SELECT DISTINCT id, name, datname, db_id FROM stv_tbl_perm | |
INNER JOIN pg_database | |
ON stv_tbl_perm.db_id = pg_database.oid | |
) AS t | |
ON t.id = stv_blocklist.tbl | |
GROUP BY name, datname |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env sh | |
BUCKET=<bucket name> | |
PATH=<path to file(s)> | |
for key in `/usr/bin/aws s3api list-objects --bucket $BUCKET --prefix $PATH | /usr/bin/jq -r '.Contents[].Key'` | |
do | |
echo $key | |
/usr/bin/aws s3 cp s3://$BUCKET/$key - | /usr/bin/wc -l | |
done |
This guide is a compilation of four other guides. It instructs how to create a set of GnuPG keys which the master key is offline and the actual subkeys only live inside your YubiKey (acting as a smartcard). What ends up in your (online) daily machine are only the stubs of the subkeys.
OlderNewer