Get Homebrew installed on your mac if you don't already have it
Install highlight. "brew install highlight". (This brings down Lua and Boost as well)
Get Homebrew installed on your mac if you don't already have it
Install highlight. "brew install highlight". (This brings down Lua and Boost as well)
# | |
## Add these gems to your Gemfile, and be sure to 'bundle install' | |
# | |
gem 'net-ldap' | |
gem 'rubycas-client' |
#!/usr/bin/env sh | |
## | |
# This is script with usefull tips taken from: | |
# https://github.com/mathiasbynens/dotfiles/blob/master/.osx | |
# | |
# install it: | |
# curl -sL https://raw.github.com/gist/2108403/hack.sh | sh | |
# |
var user = { | |
validateCredentials: function (username, password) { | |
return ( | |
(!(username += '') || username === '') ? { error: "No Username Given.", field: 'name' } | |
: (!(username += '') || password === '') ? { error: "No Password Given.", field: 'pass' } | |
: (username.length < 3) ? { error: "Username is less than 3 Characters.", field: 'name' } | |
: (password.length < 4) ? { error: "Password is less than 4 Characters.", field: 'pass' } | |
: (!/^([a-z0-9_-]+)$/i.test(username)) ? { error: "Username contains invalid characters.", field: 'name' } | |
: false | |
); |
from osgeo import osr | |
srs = osr.SpatialReference() | |
wkt_text = 'PROJCS["Transverse Mercator",GEOGCS["GCS_Everest_1830",DATUM["D_Everest_1830",SPHEROID["Everest_1830",6377299.36,300.8017]],PRIMEM["Greenwich",0.0],UNIT["Degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["False_Easting",500295.0],PARAMETER["False_Northing",-2000090.0],PARAMETER["Central_Meridian",90.0],PARAMETER["Scale_Factor",0.9996],PARAMETER["Latitude_Of_Origin",0.0],UNIT["Meter",1.0]]' | |
srs.importFromWkt(wkt_text) | |
srs.ExportToProj4() |
#!/usr/bin/env python | |
# An `ad-hoc` script to change user interface language | |
# for Anki2 on Ubuntu 12.04 desktop. | |
# Usage: anki2-change-defaultLang-to-en.py [lang] | |
# | |
# Examples: | |
# # Change to english interface | |
# $ anki2-change-defaultLang-to-en.py en |
import contextlib | |
import subprocess | |
# Unix, Windows and old Macintosh end-of-line | |
newlines = ['\n', '\r\n', '\r'] | |
def unbuffered(proc, stream='stdout'): | |
stream = getattr(proc, stream) | |
with contextlib.closing(stream): | |
while True: | |
out = [] |
This can reduce files to ~15% of their size (2.3M to 345K, in one case) with no obvious degradation of quality.
ghostscript -sDEVICE=pdfwrite -dCompatibilityLevel=1.4 -dPDFSETTINGS=/printer -dNOPAUSE -dQUIET -dBATCH -sOutputFile=output.pdf input.pdf
Other options for PDFSETTINGS: