Skip to content

Instantly share code, notes, and snippets.

View malkitsingh's full-sized avatar
🎯
Focusing

Malkit Singh malkitsingh

🎯
Focusing
View GitHub Profile
@malkitsingh
malkitsingh / allow cors.xml
Last active August 29, 2015 14:10
to allow cross site service call for web api
<system.webServer>
<httpProtocol>
<customHeaders>
<!-- Adding the following custom HttpHeader will help prevent CORS from stopping the Request-->
<add name="Access-Control-Allow-Origin" value="*" />
</customHeaders>
</httpProtocol>
</system.webServer>
@malkitsingh
malkitsingh / apna taste test queies.sql
Last active August 29, 2015 14:10
apna taste testing queries
select * from orders
select * from orders ORDER BY id DESC
@malkitsingh
malkitsingh / iOS
Created December 2, 2014 16:59
objective C defining useful constants
#define TimeZone [[NSTimeZone localTimeZone] name]
#define IS_IPHONE_6_PLUS ([[UIScreen mainScreen] respondsToSelector:@selector(nativeScale)] && [UIScreen mainScreen].nativeScale > 2.1)
#define IS_IPHONE_4 (fabs((double)[[UIScreen mainScreen]bounds].size.height - (double)480) < DBL_EPSILON)
#define IS_IPHONE_5 (fabs((double)[[UIScreen mainScreen]bounds].size.height - (double)568) < DBL_EPSILON)
#define IS_IPHONE_6 (fabs((double)[[UIScreen mainScreen]bounds].size.height - (double)667) < DBL_EPSILON)
#define IS_IPHONE5 (([[UIScreen mainScreen] bounds].size.height-568)?NO:YES)
#define IS_OS_5_OR_LATER ([[[UIDevice currentDevice] systemVersion] floatValue] >= 5.0)
#define IS_OS_6_OR_LATER ([[[UIDevice currentDevice] systemVersion] floatValue] >= 6.0)
@malkitsingh
malkitsingh / 0_reuse_code.js
Last active August 29, 2015 14:10
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