Skip to content

Instantly share code, notes, and snippets.

View ento's full-sized avatar

ento

View GitHub Profile
SLAVE STOP;
CHANGE master to master_log_file=Relay_Master_Log_File,master_log_pos=Exec_Master_Log_Pos;
SLAVE START;
/* This greasemonkey script automatically BCCs (or CCs) outgoing email from
* a gmail address to a specified email address
*
* Author: Jaidev K Sridhar mail<AT>jaidev<DOT>info
*
* Copyright (c) 2005-2008, Jaidev K Sridhar
* Released under the GPL license
* http://www.gnu.org/copyleft/gpl.html
*/
@ento
ento / Inject Javascript Profiler on document load
Created August 28, 2009 00:31
User script to inject Javascript Profiler on document load
/*
*
* Author: ento
*
* Copyright (c) 2005-2008, Jaidev K Sridhar
* Released under the GPL license
* http://www.gnu.org/copyleft/gpl.html
*/
// ==UserScript==
@ento
ento / gist:151861
Created July 22, 2009 07:22
How to access a variadic argument in Objective-C
- (void)variadic:(NSString*)strings, ... {
va_list lst;
NSString* each;
va_start(lst, strings);
while (each = va_arg(lst, NSString*)) {
[NSString stringWithString: each];
}
va_end(lst);
}
@ento
ento / python.py
Created July 14, 2009 09:10
"Am I run as a script?"
if __name__ == '__main__':
main()
@ento
ento / gist:126562
Created June 9, 2009 15:03
Get script's own location in Python
import os
local_dir = os.path.dirname(__file__)
abs_dir = os.path.join(os.getcwd(), local_dir)
if __name__ == "__main__":
print("Hello World!")