This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function hak_image_id() { | |
global $hak_thisimage; | |
if($hak_thisimage) { | |
return $hak_thisimage['id']; | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function hak_thumbnail_url() { | |
global $hak_thisimage, $img_dir; | |
if (!empty($hak_thisimage["thumbnail"])) { | |
$out= hu.$img_dir.'/'.$id.'t'.$ext; | |
return $out; | |
} | |
} | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
;; | |
;; Emacs smart tabs functionality | |
;; Intelligently indent with tabs, align with spaces! | |
;; | |
;; Note: Indenting only uses tabs when indent-tabs-mode is non-nil, | |
;; otherwise it uses spaces as usual. | |
;; | |
;; To use: save as smarttabs.el in your .emacs.d directory, and add | |
;; "(require 'smarttabs)" to your .emacs file. | |
;; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?PHP | |
$read = fopen("in.csv", "r"); | |
$write = fopen("out.csv", "w"); | |
while (!feof($read) ) { | |
$line = fgetcsv($read, 1024); | |
if ($line[2] == "what I want") { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# On Vagrant Box | |
wget -c \ | |
http://download.virtualbox.org/virtualbox/4.1.12/VBoxGuestAdditions_4.1.12.iso \ | |
-O VBoxGuestAdditions_4.1.12.iso | |
sudo mount VBoxGuestAdditions_4.1.12.iso -o loop /mnt | |
sudo sh /mnt/VBoxLinuxAdditions.run --nox11 | |
rm *.iso |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
;;; flymake.el -- a universal on-the-fly syntax checker | |
;; Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009 | |
;; Free Software Foundation, Inc. | |
;; Author: Pavel Kobyakov <[email protected]> | |
;; Maintainer: Pavel Kobyakov <[email protected]> | |
;; Version: 0.3 | |
;; Keywords: c languages tools |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Source: https://gist.github.com/4702275 | |
# | |
# All-purpose gist tool for Pythonista. | |
# | |
# When run directly, this script sets up four other scripts that call various | |
# functions within this file. Each of these sub-scripts are meant for use as | |
# action menu items. They are: | |
# | |
# Set Gist ID.py - Set the gist id that the current file should be | |
# associated with. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
CREATE USER username WITH PASSWORD 'myPassword'; | |
CREATE DATABASE dbname; | |
GRANT ALL PRIVILEGES ON DATABASE dbname TO username; | |
ALTER USER username CREATEDB; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
pyclean() { | |
find . -name "*.pyc" -delete | |
find . -type d -empty -delete | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def filtered_dict(d, keys): | |
return {key: d[key] for key in keys if d.get(key) is not None} |
OlderNewer