Update: please note that I have since switched to using a set of bash scripts instead of poluting the Git repository with git svn
.
Author: Kaspars Dambis
kaspars.net / @konstruktors
#!/bin/bash | |
# Script to convert PDF file to JPG images | |
# | |
# Dependencies: | |
# * pdftk | |
# * imagemagick | |
PDF=$1 |
<?php | |
// force download of CSV | |
// simulate file handle w/ php://output, direct to output (from http://www.php.net/manual/en/function.fputcsv.php#72428) | |
// (could alternately write to memory handle & read from stream, this seems more direct) | |
// headers from http://us3.php.net/manual/en/function.readfile.php | |
header('Content-Description: File Transfer'); | |
header('Content-Type: application/csv'); | |
header("Content-Disposition: attachment; filename=FILENAME.csv"); | |
header('Cache-Control: must-revalidate, post-check=0, pre-check=0'); |
<?php | |
class Mysql{ | |
static private $link = null; | |
static private $info = array( | |
'last_query' => null, | |
'num_rows' => null, | |
'insert_id' => null | |
); |
<?php | |
// Include the phpQuery library | |
// Download at http://code.google.com/p/phpquery/ | |
include 'phpQuery.php'; | |
// Load Mike Fisher's player page on thescore.com | |
$ch = curl_init(); | |
curl_setopt($ch, CURLOPT_URL, 'http://www.thescore.com/nhl/player_profiles/859-mike-fisher'); | |
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); |
import sublime | |
import sublime_plugin | |
import os | |
import sys | |
import json | |
import base64 | |
import urllib2 | |
import subprocess | |
import functools | |
import webbrowser |
<html> | |
<head> | |
<title></title> | |
</head> | |
<body> | |
<div id="pulser"> | |
<div class="pulse pulse1"></div> | |
<div class="pulse pulse2"></div> | |
<div class="pulse pulse3"></div> |
Update: please note that I have since switched to using a set of bash scripts instead of poluting the Git repository with git svn
.
Author: Kaspars Dambis
kaspars.net / @konstruktors
gconftool-2 --set --type list --list-type=string /apps/compiz-1/general/screen0/options/active_plugins '[core,composite,opengl,decor,resize,imgpng,unitymtgrabhandles,snap,compiztoolbox,vpswitch,mousepoll,gnomecompat,place,regex,animation,move,staticswitcher,session,unityshell,workarounds]' | |
gconftool-2 --set /apps/compiz-1/plugins/switcher/screen0/options/prev_all_key --type string "Disabled" | |
gconftool-2 --set /apps/compiz-1/plugins/switcher/screen0/options/next_all_key --type string "Disabled" | |
gconftool-2 --set /apps/compiz-1/plugins/switcher/screen0/options/prev_key --type string "Disabled" | |
gconftool-2 --set /apps/compiz-1/plugins/switcher/screen0/options/next_key --type string "Disabled" | |
gconftool-2 --set /apps/compiz-1/plugins/unityshell/screen0/options/alt_tab_prev --type string "Disabled" | |
gconftool-2 --set /apps/compiz-1/plugins/unityshell/screen0/options/alt_tab_forward --type string "Disabled" |
<?php | |
function translit($str) { | |
$tr = array("а"=>"a","б"=>"b","в"=>"v","г"=>"g","д"=>"d","е"=>"e","ё"=>"e","ж"=>"j","з"=>"z","и"=>"i","й"=>"y","к"=>"k","л"=>"l","м"=>"m","н"=>"n","о"=>"o","п"=>"p","р"=>"r","с"=>"s","т"=>"t","у"=>"u","ф"=>"f","х"=>"h","ц"=>"c","ч"=>"ch","ш"=>"sh","щ"=>"shh","ъ"=>"","ы"=>"y","ь"=>"","э"=>"e","ю"=>"u","я"=>"ya","—"=>"-","«"=>"","»"=>"","…"=>""," "=>"-","№"=>"#"); | |
$str = mb_strtolower($str,'utf-8'); | |
// $str = preg_replace("/\s+/",' ',$str); | |
$str = strtr(trim($str), $tr); | |
$str = trim(preg_replace("/\-+/",'-',$str),'- '); | |
$str = preg_replace('~[^a-z0-9/-]~', '', $str); | |
return $str; |