Skip to content

Instantly share code, notes, and snippets.

View semencov's full-sized avatar

Yuri Sementsov semencov

View GitHub Profile
# nginx/conf/vhosts/
cat * | grep server_name | sed 's/.*name *//g' | sed 's:;::g'
/*
---
name: guilloche
script: guilloche.js
description: guilloche
provides: [Guilloche]
...
*/
@benbahrenburg
benbahrenburg / gist:948579
Created April 29, 2011 16:32
Login Example
// create tab group
demo.tabMainGroup = Ti.UI.createTabGroup({isOpen:false});
demo.tabLoginGroup = Ti.UI.createTabGroup({isOpen:false});
demo.wLogin = Ti.UI.createWindow({
id:'wLogin'
});
demo.tbLogin = Ti.UI.createTab({window:demo.wLogin});
@josedaniel
josedaniel / localStorage.js
Created May 31, 2011 21:55
Local storage cookies fallback
if (!window.localStorage){
function createCookie(name,value,days) {
if (days) {
var date = new Date();
date.setTime(date.getTime()+(days*24*60*60*1000));
var expires = "; expires="+date.toGMTString();
}
else var expires = "";
document.cookie = name+"="+value+expires+"; path=/";
}
@p01
p01 / LICENSE.txt
Last active May 23, 2024 13:46 — forked from 140bytes/LICENSE.txt
Sudoku Solver in 140bytes
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
Version 2, December 2004
Copyright (C) 2011 Mathieu 'p01' Henri - http://www.p01.org/releases/
Everyone is permitted to copy and distribute verbatim or modified
copies of this license document, and changing it is allowed as long
as the name is changed.
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
@teerb
teerb / Teerb.itermcolors
Created November 12, 2011 12:18
Iterm2 colorscheme based on Pnevma and Xoria256
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Ansi 0 Color</key>
<dict>
<key>Blue Component</key>
<real>0.1098039299249649</real>
<key>Green Component</key>
<real>0.1098039299249649</real>
@yellowled
yellowled / ffmpeg-html5
Created December 6, 2011 19:39
Convert videos to proper formats for HTML5 video on Linux shell using ffmpeg. Will probably convert this to a bash script later, but for the time being, here's some examples. Not sure there have actually sensible dimensions and bitrates for web video.
# webm
ffmpeg -i IN -f webm -vcodec libvpx -acodec libvorbis -ab 128000 -crf 22 -s 640x360 OUT.webm
# mp4
ffmpeg -i IN -acodec aac -strict experimental -ac 2 -ab 128k -vcodec libx264 -vpre slow -f mp4 -crf 22 -s 640x360 OUT.mp4
# ogg (if you want to support older Firefox)
ffmpeg2theora IN -o OUT.ogv -x 640 -y 360 --videoquality 5 --audioquality 0 --frontend
anonymous
anonymous / phpLiteObfuscator.php
Created December 20, 2011 14:54
PHP Obfuscator / Compressor
<?php
/**
* Coded by PabloBandin ( p58l0.84nd1n@gmail.com )
*/
/**
* @example
* <pre>
$file = file_get_contents("someFile.php");
@JeffreyWay
JeffreyWay / gist:1525217
Created December 27, 2011 21:29
Instant Server for Current Directory
alias server='open http://localhost:8000 && python -m SimpleHTTPServer'
@stpe
stpe / mantisconnect_json.php
Created March 17, 2012 22:26
Simple JSON wrapper of Mantis SOAP API
<?php
/**
* Example usage (using jQuery):
* var url = "/path/mantisconnect_json.php?name=mc_project_get_issues&project_id=0&page_number=1&per_page=10";
* $.getJSON(url, function(data) {
* $.each(data, function() {
* console.log(data.id + ': ' data.summary);
* });
* });
*/