Skip to content

Instantly share code, notes, and snippets.

View zaki's full-sized avatar

Dezső Zoltán zaki

View GitHub Profile
@zaki
zaki / bootstrap.sh
Created January 3, 2013 13:11
Personalized workstation setup based on pivotal workstation
#!/bin/bash
# This shell script was created at solowizard.com
#
# http://github.com/tommyh/solo_wizard
# (c) 2012, Tom Hallett
# This script may be freely distributed under the MIT license.
pushd `pwd`
if rvm --version 2>/dev/null; then
gem install soloist
@zaki
zaki / array.c
Created October 11, 2012 12:39
TokyoRails contribute to ruby project for fun: Array#transpose with uneven arrays
static VALUE
rb_ary_transpose_test(VALUE ary)
{
long elen = -1, alen, i, j, k;
VALUE tmp, result = 0;
// get the longest sub-array so we know how much to extend to
long elen_max = -1;
for (i=0; i<alen; i++) {
@zaki
zaki / rename_linkage.jsfl
Created August 30, 2012 02:08
Rename linkages in Flash
function add_linkage(doc){
var package=prompt('Choose a package or leave it blank','');
if(package==null){
alert('Command cancelled by user');
}
var library=doc.library;
var items=library.items;
var items_length=items.length;
for(var h = 0; h < items_length; h++){
@zaki
zaki / metro_scraping.js
Created April 26, 2012 06:31
Metro Scraping Memo
$("#timeTable > table > tbody > tr").each(function() { var hour = ($(".hour", this).text()); var times = []; $(".timeData", this).each(function() { times.push($(".info01", this).text().replace(/\s+/g, '')+" "+$(".info02", this).text().replace(/\s+/g, '')+" "+$(this).attr('class').replace(/timeData|dir|\s+/g, '')); }); console.log(hour, times)})
@zaki
zaki / start.sh
Created January 30, 2012 13:04
Start Chrome with iOS User-Agent
/Applications/Google\ Chrome.app/Contents/MacOS/Google\ Chrome --user-agent="Mozilla/5.0 (iPhone; U; CPU like Mac OS X; en) AppleWebKit/420+ (KHTML, like Gecko) Version/3.0 Mobile/1A543 Safari/419.3"
@zaki
zaki / user.css
Created January 18, 2012 07:12
Wikipedia blackout override
/* Please only use this workaround if you really just HAVE TO use wikipedia today */
#mw-page-base, #mw-head-base, #mw-head, #mw-panel, #footer, #content { display: block !important; }
#mw-sopaOverlay { display: none; }
/* SOPA HAS WON, IT HAS BLACKED OUT WIKIPEDIA ;) */
@zaki
zaki / bootstrap.html5.css
Created August 30, 2011 04:02
Twitter Bootstrap HTML5 email tag addition
input[type=email]
{
display: inline-block;
width: 210px;
padding: 4px;
font-size: 13px;
line-height: 18px;
height: 18px;
color: #808080;
border: 1px solid #ccc;
@zaki
zaki / custom-syntax.php
Created July 5, 2011 10:06
IL Brush for Wordpress Syntax Highlighter Evolved
<?php
/*
* Plugin Name: SyntaxHighlighter Evolved: Custom Brushes
* Description: Adds support for IL code to the SyntaxHighlighter Evolved plugin.
* Author: Zoltan Dezso
* Version: 1.0.0
* Author URI: http://zaki.asia
* */
add_action( 'init', 'syntaxhighlighter_il_regscript' );
@zaki
zaki / ti.md
Created June 14, 2011 10:25
Titanium Appcelerator Platform Specific Examples

#iOS:

base_ui

  • Tabs
  • Window NavBar
  • Window Toolbar
  • Window Constructor
  • Animation
  • Nav Group
  • Modal Windows
  • Custom Fonts
@zaki
zaki / ruby_lambda_closure.rb
Created March 22, 2011 08:00
Ruby Lambda Closure
x = 1 # Variable defined outside lambda
# 1. lambda closes over outside env, so you can use x if was in scope when
# lambda was defined
lmbd1 = lambda { print x }
lmbd1.call # => 1
# 2.1 the outside var must exist and be in scope when you define lambda
lmbd2_1 = lambda { print u }
u = 1