This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// was used when API address moved but apps were live on app store. | |
$ch = curl_init(); | |
$path = $_SERVER['REQUEST_URI']; | |
$path = str_replace('/api/index.php','',$path); | |
$path = str_replace('/api/','/',$path); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* inspect a javascript object | |
http://codeinthehole.com/writing/inspecting-javascript-objects/ | |
Usage: Inspect.properties(variable); | |
Inspect.methods(variable); | |
*/ | |
var Inspect = { | |
TYPE_FUNCTION: 'function', | |
// Returns an array of (the names of) all methods | |
methods: function(obj) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* This file is part of the Spludo Framework. | |
* Copyright (c) 2009-2010 DracoBlue, http://dracoblue.net/ | |
* | |
* Licensed under the terms of MIT License. For the full copyright and license | |
* information, please see the LICENSE file in the root folder. | |
*/ | |
var server_filename = "server.js"; | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
NSDate *today = [NSDate date]; | |
NSCalendar *gregorian = [[NSCalendar alloc] initWithCalendarIdentifier:NSGregorianCalendar]; | |
[gregorian setLocale:[NSLocale currentLocale]]; | |
NSDateComponents *nowComponents = [gregorian components:NSYearCalendarUnit | NSWeekCalendarUnit | NSHourCalendarUnit | NSMinuteCalendarUnit | NSSecondCalendarUnit fromDate:today]; | |
[nowComponents setWeekday:2]; //Monday | |
[nowComponents setHour:0]; //1 a.m. | |
[nowComponents setMinute:0]; | |
[nowComponents setSecond:0]; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Format specifiers: | |
%@ NSString* | |
%d Signed Integer | |
%i Signed Integer | |
%u Unsigned Integer | |
%f Float / Double | |
%x Hexidecimal Integer | |
%X Hexidecimal Integer | |
%o Octal Integer | |
%zu size_t |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
NSDateFormatter specifiers: | |
a: AM/PM | |
A: 0~86399999 (Millisecond of Day) | |
c/cc: 1~7 (Day of Week) | |
ccc: Sun/Mon/Tue/Wed/Thu/Fri/Sat | |
cccc: Sunday/Monday/Tuesday/Wednesday/Thursday/Friday/Saturday | |
d: 1~31 (0 padded Day of Month) | |
D: 1~366 (0 padded Day of Year) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
NSDictionary *data = [NSDictionary dictionaryWithObjectsAndKeys:@"Object", @"Key" , nil]; | |
NSData *jsonData = [NSJSONSerialization dataWithJSONObject:data options:0 error:nil]; // can give option NSJSONWritingPrettyPrinted | |
NSString *jsonString = [[NSString alloc] initWithData:jsonData encoding:NSUTF8StringEncoding]; | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<IfModule mod_rewrite.c> | |
Options +FollowSymLinks | |
RewriteEngine on | |
RewriteRule (.*) http://www.gamehorizonconference.com/ [R=301,L] | |
</IfModule> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
find * -name "*.js" -print0 | xargs -0 /usr/bin/dos2unix | |
find * -name "*.css" -print0 | xargs -0 /usr/bin/dos2unix | |
find * -name "*.htm" -print0 | xargs -0 /usr/bin/dos2unix | |
find * -name "*.html" -print0 | xargs -0 /usr/bin/dos2unix | |
find * -name "*.php" -print0 | xargs -0 /usr/bin/dos2unix | |
#etc | |
#where /usr/bin/dos2unix is: | |
#!/bin/sh |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
if(empty($_SERVER['HTTPS'])) | |
{ | |
// If not, redirect | |
$newurl = 'https://'.$_SERVER['SERVER_NAME'].$_SERVER['REQUEST_URI']; | |
header("location: $newurl"); | |
exit(); | |
} |
OlderNewer