Skip to content

Instantly share code, notes, and snippets.

@rauluranga
rauluranga / uninstall Visor app
Created December 10, 2010 00:45
uninstall Visor app
rm -rf ~/Library/Application\ Support/SIMBL/Plugins/Visor.bundle
@rauluranga
rauluranga / Eclipse AntiAliasingThreshold
Created December 10, 2010 00:48
Eclipse AntiAliasingThreshold for programming fonts like ProggyClean
defaults write org.eclipse.eclipse AppleAntiAliasingThreshold 17
@rauluranga
rauluranga / bounds constraint
Created January 26, 2011 17:38
constraint a number between defined limits.
Math.max(MIN_LIMIT,Math.min(value_num,MAX_LIMIT));
@rauluranga
rauluranga / AS3 Variable Binding
Created February 1, 2011 01:44
replace all the '?' in the passed string with the corresponding parameter
/**
* @example
var sql:String = "SELECT * FROM some_table WHERE id = ? AND status = ? AND author = ?";
trace(binding(sql, 3, "live", "Rick"));
//outputs SELECT * FROM some_table WHERE id = 3 AND status = live AND author = Rick
*/
public static function binding(msg:String, ... rest):String
{
for (var i:int = 0;i < rest.length;i++) {
@rauluranga
rauluranga / revert commit SVN
Created February 8, 2011 19:38
revert (roll back) to a previous revision with Subversion
svn merge -r [current_version]:[previous_version] [repository_url]
#example:
svn merge --dry-run -r 73:68 http://my.repository.com/my/project/trunk
svn merge -r 73:68 http://my.repository.com/my/project/trunk
svn commit -m "Reverted to revision 68."
@rauluranga
rauluranga / gist:1126409
Created August 4, 2011 22:01
delete all .svn folder in Mac/Linux
find ./ -name ".svn" | xargs rm -Rf
@rauluranga
rauluranga / a_old_ga_sample_code.html
Created November 15, 2011 18:51
GA Asynchronous Migration
<script type="text/javascript">
var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www.");
document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E"));
</script>
<script type="text/javascript">
try {
var pageTracker = _gat._getTracker("XX-XXXXXXXX-X");
pageTracker._trackPageview();
} catch(err) {}
@rauluranga
rauluranga / gist:2002497
Created March 8, 2012 18:26
termial:rename all files to lowercase?
for f in *; do mv "$f" "`echo $f | tr "[:upper:]" "[:lower:]"`"; done
@rauluranga
rauluranga / main.lua
Created August 13, 2012 22:39
LUA:Corona output in Sublime Text console
io.output():setvbuf("no")
@rauluranga
rauluranga / cloneReposFromFile.sh
Created January 30, 2013 18:35
Clone multiples git repositories from text file.
#!/bin/bash
for LINE in `cat "$1"`; do
echo 'start cloning repo:' : $LINE;
git clone $LINE
done