Skip to content

Instantly share code, notes, and snippets.

Keybase proof

I hereby claim:

  • I am haqu on github.
  • I am haqu (https://keybase.io/haqu) on keybase.
  • I have a public key whose fingerprint is 97A1 696A ABA7 D93E 7FFC 7C6C D74B F945 4E4E E3F6

To claim this, I am signing this object:

@haqu
haqu / gist:1016550
Created June 9, 2011 11:25
decoding PNG images from IPA package
mkdir _png
/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/pngcrush -d _png -revert-iphone-optimizations -q *.png
@haqu
haqu / gist:978315
Created May 18, 2011 10:03
Ludum Dare stats usage example
$ ./stats.rb Draknek
Getting number of votes and coolness from Ludum Dare ratings page
and calculating current position based on the "votes" stat.
1. deepnight (106:3)
2. natpat (65:18)
3. adamatomic (59:0)
4. haqu (55:288)
5. intmain (50:13)
@haqu
haqu / stats.rb
Created May 17, 2011 04:01
Getting number of votes and coolness from Ludum Dare ratings page
#!/usr/bin/env ruby -wKU
# if you don't want to provide your username each time
# as an argument, you can set it here:
user = "" # <-- your username
# default stat to compare: votes or coolness
compare = "votes" # or "coolness"
######################################################
@haqu
haqu / ava.rb
Created February 21, 2011 15:30
Domain availability checker
#!/usr/bin/env ruby -wKU
# Examples of usage:
# $ ava domain.com another.* unique765.{com,net}
# [-] domain.com
# [-] another.com
# [-] another.net
# [+] another.st
# [+] unique765.com
# [+] unique765.net
@haqu
haqu / lip.rb
Created February 21, 2011 15:26
IP Location on Google Maps
#!/usr/bin/env ruby -w
# Example of usage:
# $ ./lip.rb snippets.dzone.com
# Hostname: snippets.dzone.com
# Country Code: US
# Country Name: United States
# Region: CA
# Region Name: California
# City: Los Angeles
@haqu
haqu / istudio-recent-comments.php
Created May 7, 2010 03:33
Recent comments for iStudio theme
<?php
/**
* Plugin Name: iStudio Recent Comments
* Version: 1.0
* Plugin URI: http://gist.github.com/393013
* Description: Recent comments for iStudio theme
* Author: Sergey Tikhonov
* Author URI: http://haqu.net
*/
class WP_Widget_iStudio_Recent_Comments extends WP_Widget {
@haqu
haqu / relative_date.php
Created September 6, 2009 01:17
relative date
<?
# relative_date
# usage: relative_date("2009-09-09 9:09:09") => "9 minutes ago"
# just now, 25 seconds ago... yesterday, 5 days ago, 3 months ago
function pluralize($count,$word) {
if($count == 0) {
return "no ".$word."s";
} else if($count == 1) {
return "1 ".$word;
@haqu
haqu / rmultirename
Created May 28, 2009 15:47 — forked from vrybas/rmultirename.rb
mass rename
#!/usr/bin/env ruby
def show_usage
puts "Usage: #{$0} [PATTERN] [REPLACEMENT]"
puts "Example: #{$0} htm html"
exit
end
pattern = ARGV[0] || show_usage
replace = ARGV[1] || show_usage
@haqu
haqu / wefollow.rb
Created May 21, 2009 11:52
follow wefollow
#!/usr/bin/env ruby
# script to extract and follow users from wefollow directory
# example:
# $ ./wefollow.rb iphonedev
# this will extract users from http://wefollow.com/tag/iphonedev
# and add them to your 'following' list
tag = ARGV[0] || exit