Skip to content

Instantly share code, notes, and snippets.

View tudormunteanu's full-sized avatar
👨‍💻
Crafting and leading. 🛠️🚀 #TechLeader #OptimiseForLearning

Tudor M tudormunteanu

👨‍💻
Crafting and leading. 🛠️🚀 #TechLeader #OptimiseForLearning
View GitHub Profile
@tudormunteanu
tudormunteanu / gist:1844610
Created February 16, 2012 12:47
jQuery plugin authoring
(function($){
$.fn.myName = function() {
return this.each(function() {
var t = $(this);
});
@tudormunteanu
tudormunteanu / gist:1853064
Created February 17, 2012 12:20
nsdocuments dir
NSString *documents = [NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES) objectAtIndex:0];
@tudormunteanu
tudormunteanu / gist:1923024
Last active October 1, 2015 04:48
git aliases and config commands [to be run in command line]
git config --global alias.ci commit
git config --global alias.st status
git config --global alias.p push
git config --global alias.co checkout
git config --global color.branch auto
git config --global color.diff auto
git config --global color.interactive auto
git config --global color.status auto
git config --global color.ui true
@tudormunteanu
tudormunteanu / gist:1923034
Created February 27, 2012 10:40
Base for standalone python scripts
"""
Author: Tudor Munteanu
License: CC
"""
import os
import urllib
def my_func():
pass
@tudormunteanu
tudormunteanu / gist:1924037
Created February 27, 2012 14:08
Security
Server - private key
- can decrypt
- can sign
Client - public
- can encrypt
- can check signature
Encryption with Stream ciphers - AES 256
@tudormunteanu
tudormunteanu / gist:1948389
Created March 1, 2012 08:42
rm for huge number of files
0x002:/some/folder# find . -name 'thumb_*' | xargs rm
@tudormunteanu
tudormunteanu / gist:1996287
Created March 7, 2012 21:13
FileManagerHelper
// FileManagerHelper.h
#import <Foundation/Foundation.h>
@interface FileManagerHelper : NSObject
+ (void) cleanDocumentsDir;
+ (void) changeCapitalJPGNames;
//
@tudormunteanu
tudormunteanu / gist:2001265
Created March 8, 2012 14:35
UIAlertView (basic)
UIAlertView *alert = [[[UIAlertView alloc] initWithTitle:@"Opened from URL"
message:@"App opened trough URL"
delegate:self
cancelButtonTitle:@"Ok"
otherButtonTitles:nil] autorelease];
// optional - add more buttons:
[alert addButtonWithTitle:@"Yes"];
[alert show];
//
@tudormunteanu
tudormunteanu / gist:2017482
Last active October 1, 2015 15:38
Obj-c singleton
//
// Non-thread safe
//
@interface MySingleton : NSObject
{
}
+ (MySingleton *)sharedSingleton;
@end
@tudormunteanu
tudormunteanu / gist:2064319
Created March 17, 2012 19:10
iOS disable screen dimming
[[UIApplication sharedApplication] setIdleTimerDisabled:YES];