A ZSH theme optimized for people who use:
- Solarized
- Git
- Unicode-compatible fonts and terminals (I use iTerm2 + Menlo)
| #! /usr/bin/env python | |
| """ Convert values between RGB hex codes and xterm-256 color codes. | |
| Nice long listing of all 256 colors and their codes. Useful for | |
| developing console color themes, or even script output schemes. | |
| Resources: | |
| * http://en.wikipedia.org/wiki/8-bit_color | |
| * http://en.wikipedia.org/wiki/ANSI_escape_code | 
| # -*- coding: utf-8 -*- | |
| import gdata.contacts.client | |
| import gdata.contacts.data | |
| USER = "" | |
| PASSWD = "" | |
| PREFIX = '041' | |
| def add_prefix_to_contacts(gd_client, prefix): | 
| require 'ffi' | |
| class Filesystem | |
| extend FFI::Library | |
| ffi_lib FFI::Library::LIBC | |
| attach_function(:strerror, [:int], :string) | |
| attach_function(:getmntinfo64, [:pointer, :int], :int) | |
| class Statfs < FFI::Struct | 
| #!/bin/sh | |
| ## | |
| # This is a script with usefull tips taken from: | |
| # https://github.com/mathiasbynens/dotfiles/blob/master/.osx | |
| # | |
| # Run in interactive mode with: | |
| # $ sh -c "$(curl -sL https://raw.github.com/gist/2108403/hack.sh)" | |
| # | |
| # or run it without prompt questions: | 
| -- show running queries (pre 9.2) | |
| SELECT procpid, age(clock_timestamp(), query_start), usename, current_query | |
| FROM pg_stat_activity | |
| WHERE current_query != '<IDLE>' AND current_query NOT ILIKE '%pg_stat_activity%' | |
| ORDER BY query_start desc; | |
| -- show running queries (9.2) | |
| SELECT pid, age(clock_timestamp(), query_start), usename, query | |
| FROM pg_stat_activity | |
| WHERE query != '<IDLE>' AND query NOT ILIKE '%pg_stat_activity%' | 
| #!/usr/bin/env python3 | |
| """ | |
| ZSH history convert script. | |
| When you mistakenly type your password or quite bad command into ZSH, | |
| you may want to remove the entry from the history. | |
| The problem is, the .zsh_history is encoded in a weird format! | |
| If you want to find a command with non-ASCII character, it'll be problematic. | 
| /* Copyright 2013 Jakub Jirutka. All rights reserved. | |
| * | |
| * "THE KOFOLA-WARE LICENSE" (Revision 1): | |
| * Jakub Jirutka originally wrote this file. As long as you retain this notice you | |
| * can do whatever you want with this stuff. If we meet some day, and you think | |
| * this stuff is worth it, you can buy me a Kofola in return. <[email protected]> | |
| */ | |
| import java.io.File; | |
| import java.io.FileNotFoundException; | 
| sourceSets { | |
| generated { | |
| java { | |
| srcDirs = ['src/main/generated'] | |
| } | |
| } | |
| } | |
| configurations { | |
| querydslapt |