Skip to content

Instantly share code, notes, and snippets.

View tlatsas's full-sized avatar

Tasos Latsas tlatsas

View GitHub Profile
@tlatsas
tlatsas / xmonad.hs
Created August 2, 2011 15:31 — forked from doitian/xmonad.hs
xmonad.hs
{-# OPTIONS_GHC -fcontext-stack=32 #-}
import XMonad hiding ( (|||) )
import qualified XMonad.StackSet as W
import Control.OldException(catchDyn,try)
import Data.Char (toLower)
import Data.List (intercalate, intersperse, isSuffixOf, isPrefixOf)
import qualified Data.Map as M (fromList)
@tlatsas
tlatsas / _config.yml
Created August 12, 2011 11:30 — forked from edavis10/_config.yml
Pagination in Jekyll
# ....other stuff here
paginate: 10
@tlatsas
tlatsas / jekyll-post.sh
Created August 23, 2011 10:16
jekyll post template generator
if [[ -z $1 ]]; then
echo "A post title is required. Bye.."
exit 1
fi
_post=$(echo $1 | tr ' ' '-')
_date=$(date +'%Y-%m-%d')
_datetime=$(date +'%Y-%m-%d %H:%M:%S')
_title="${_date}-${_post}.markdown"
_cwd=$(pwd)
@tlatsas
tlatsas / tpe2-bash.sh
Created August 26, 2011 07:37
add album artist tag
for f in *; do id3v2 --TPE2 "Various Artists" "${f}"; done
$ convert -quality 80 fig.png fig.jpg
I find a quality factor of 80 on high resolution images gives good compresssion without too much loss in quality. You can then to convert the image to eps using "convert" with the eps2 settings:
$ convert fig.jpg eps2:fig.eps
If you can use level 3 postscript, you can convert directly from png to eps:
$ convert fig.png eps3:fig.eps
@tlatsas
tlatsas / gist:1202985
Created September 8, 2011 09:11
redshift - red screen for night watching
redshift -l 37.993854:23.829346 -o -v -g 1:0.1:0.1 -t 1000:1000 -b 0.5
@tlatsas
tlatsas / gist:1202988
Created September 8, 2011 09:13
redshift config sample
; Global settings
[redshift]
temp-day=5700
temp-night=3500
transition=1
gamma=0.8:0.7:0.8
location-provider=manual
adjustment-method=vidmode
; The location provider and adjustment method settings
def unique(l):
s = set(); n = 0
for x in l:
if x not in s: s.add(x); l[n] = x; n += 1
del l[n:]
@tlatsas
tlatsas / gmail-tunnel.sh
Created September 9, 2011 12:15
tunel gmail imap though your server
#!/bin/sh
# Tunnel imap connection through your server
_server="your-server-here"
_port="your-server-port-here"
_username="your-server-login-name"
# tunnel gmail imap (imap.gmail.com:993) <-> (localhost:10993)
ssh -f -N -L localhost:10993:imap.gmail.com:993 -p ${_port} -l ${_username} ${_server}
find -L -maxdepth 1 -type l -delete