Skip to content

Instantly share code, notes, and snippets.

; F7 wins you a gold medal!
#MaxHotkeysPerInterval 5000
{
$F7::
Loop
{
if not GetKeyState("F7", "P")
break
else
; Basketball doodle helper. Consistent throws everytime. ;-)
; Still need a bit of skill to time the ball pickup correctly though.
Throw(time)
{
Send {Space}
sleep time
Send {Space}
return
}
" .vimrc
" See: http://vimdoc.sourceforge.net/htmldoc/options.html for details
" For multi-byte character support (CJK support, for example):
set fileencodings=ucs-bom,utf-8,cp936,big5,euc-jp,euc-kr,gb18030,latin1
set nocompatible " be iMproved
set nocompatible " be iMproved
set pastetoggle=<F2>
@imiric
imiric / Inconsolata-dz-Powerline.otf
Created October 24, 2012 00:39 — forked from qrush/Inconsolata-dz-Powerline.otf
vim-powerline patched fonts
@imiric
imiric / avg_linelength
Last active December 14, 2015 14:08
Average line length per file
for file in $(find * -name "*.py"); do
awk '{if($1 > 0){ len+=length; count+=1 }}; END {if(count > 0) {print len/count, "\t", FILENAME} }' $file
done | sort -k 1 -n -r
@imiric
imiric / django_max_line_length_avg
Last active December 14, 2015 14:08
Average of maximum line lengths of all files.
98.7973
@imiric
imiric / PKGBUILD
Last active December 16, 2015 10:59
PKGBUILD for Vagrant 1.2.1
pkgname=vagrant
pkgver=1.2.1
pkgrel=4
pkgdesc="Tool for building and distributing virtualized development environments"
arch=('i686' 'x86_64')
url='http://vagrantup.com/'
license=('MIT')
depends=('ruby' 'virtualbox>=4.0' 'ruby-net-ssh>=2.6.6' \
'ruby-net-scp>=1.1.0' 'ruby-erubis>=2.7.0' 'ruby-i18n>=0.6.0' \
'ruby-log4r>=1.1.9' 'ruby-childprocess>=0.3.7')
@imiric
imiric / init.sls
Last active December 16, 2015 11:49
pguser:
postgres_user:
- present
- name: {{ pillar['dbuser'] }}
- password: {{ pillar['dbpass'] }}
- createdb: True
- createuser: False
- superuser: True
- runas: postgres
- require:
@imiric
imiric / capicua.py
Last active December 16, 2015 14:28
#!/usr/bin/env python
def is_palindrome(num):
return str(num) == str(num)[::-1]
def closest_higher(target, collection) :
"""Return the closest number to `target` in `collection`
that is higher than `target`"""
return max((target - i, i) for i in collection if (target - i) < 0)[1]
@imiric
imiric / capicua2.py
Last active December 16, 2015 14:29
Finds palindrome numbers within a list of ranges. Input file here: https://gist.github.com/hminaya/5435673
#!/usr/bin/env pypy
def main():
palindromes = []
ranges = [[int(i) for i in line.split()] for line in open('seed.txt')]
ranges_flat = [i for r in ranges for i in r]
lo, hi = min(ranges_flat), max(ranges_flat)
while hi >= lo:
n = str(lo)
if n == n[::-1]: