Skip to content

Instantly share code, notes, and snippets.

@aero
aero / demacboogi.pl
Created July 25, 2011 07:44
Rename MacOS X NFD hangule to NFC
#!/usr/bin/env perl
# 사용법
# perl demacboogi.pl *.zip #zip파일만 변환
# perl demacboogi.pl #모든파일 변환
use 5.010;
use strict;
use warnings;
use Encode qw/encode decode/;
use Unicode::Normalize qw/compose/;
use File::Copy;
@spicycode
spicycode / tmux.conf
Created September 20, 2011 16:43
The best and greatest tmux.conf ever
# 0 is too far from ` ;)
set -g base-index 1
# Automatically set window title
set-window-option -g automatic-rename on
set-option -g set-titles on
#set -g default-terminal screen-256color
set -g status-keys vi
set -g history-limit 10000
@dweinstein
dweinstein / template.txt
Created September 5, 2012 20:42
my org-mode template for exporting to LaTeX/PDF
#+TITLE: Template org-mode document for export to LaTeX/PDF
#+AUTHOR: David Weinstein
#+LaTeX_HEADER: \usepackage[left=1in,top=1in,right=1in,bottom=1.5in]{geometry}
#+LaTeX_HEADER: \usepackage{palatino}
#+LaTeX_HEADER: \usepackage{fancyhdr}
#+LaTeX_HEADER: \usepackage{sectsty}
#+LaTeX_HEADER: \usepackage{engord}
#+LaTeX_HEADER: \usepackage{cite}
#+LaTeX_HEADER: \usepackage{graphicx}
@areina
areina / emacs-email-setup.md
Created October 12, 2012 15:00
Manage your email in emacs with mu4e

Manage your gmail account in emacs with mu4e

There're a lot of combinations to manage your email with emacs, but this works for me. I've a backup and I can manage my daily email.

The stack:

  • emacs
  • offlineimap
  • mu
  • mu4e
@ozanturksever
ozanturksever / get_uncompressed_size.py
Last active August 25, 2020 14:10
python get uncompressed size of a .gz file
def get_uncompressed_size(self, file):
fileobj = open(file, 'r')
fileobj.seek(-8, 2)
crc32 = gzip.read32(fileobj)
isize = gzip.read32(fileobj) # may exceed 2GB
fileobj.close()
return isize
import requests, random, datetime, sys, webbrowser, console
def main():
song_page = None
if (len(sys.argv) > 0):
try:
song_page = sys.argv[1]
except Exception:
song_page = None
if not song_page:
@Danik
Danik / capslock_remap_alt.ahk
Last active May 4, 2024 05:16
Autohotkey Capslock Remapping Script. Makes Capslock function as a modifier key to get cursor keys etc. on the left side of the keyboard, so you never have to move your hand to the right.
; Autohotkey Capslock Remapping Script
; Danik
; More info at http://danikgames.com/blog/?p=714
; danikgames.com
;
; Functionality:
; - Deactivates capslock for normal (accidental) use.
; - Hold Capslock and drag anywhere in a window to move it (not just the title bar).
; - Access the following functions when pressing Capslock:
; Cursor keys - J, K, L, I
@joyrexus
joyrexus / README.md
Last active June 8, 2024 00:43
Perl one-liners

Hi:

perl -e 'print "hello world!\n"'

A simple filter:

perl -ne 'print if /REGEX/'

Filter out blank lines (in place):

@ReactiveRaven
ReactiveRaven / gist:9348401
Last active December 16, 2022 18:30
Ubuntu memory tuning

Add these lines to the end of /etc/sysctl.conf:

vm.swappiness=5
vm.min_free_kbytes=122880
vm.vfs_cache_pressure=500

Run these commands as root:

sudo sysctl -w vm.swappiness=5;

sudo sysctl -w vm.min_free_kbytes=122880

@AdolfVonKleist
AdolfVonKleist / compute-best-mix.py
Last active May 29, 2020 08:50
compute-best-mix.py : Python port of the venerated SRILM tool
#!/usr/bin/python
import re, math
def LoadPPLFile (pplfile) :
"""
Load up the salient info from a -debug 2 PPL file
generated by the SRILM ngram tool.
"""
ppl_info = []