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 | |
$request_body = @file_get_contents('php://input'); | |
$request_data = json_decode($request_body, true); | |
$bundle_version = $_GET['bundleVersion']; | |
$latest_version = "1.0.1"; | |
if (version_compare($bundle_version, $latest_version, '<')) { | |
$result = array( | |
'needsUpdate' => TRUE, | |
'latestVersion' => $latest_version |
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
- (void)request:(ASIHTTPRequest *)request didReceiveData:(NSData *)data { | |
NSString *dataString = [[[NSString alloc] initWithData:data encoding:NSUTF8StringEncoding] autorelease]; | |
if ([dataString length] > 0) { | |
self.manifest = [NSDictionary dictionaryWithDictionary:[dataString JSONValue]]; | |
if ([[_manifest objectForKey:@"needsUpdate"] boolValue] == YES && [self remindNow] == YES) { | |
NSString *alertTitle = NSLocalizedString(@"Update available", nil); | |
if ([[_manifest allKeys] containsObject:@"alertTitle"]) { | |
alertTitle = [_manifest objectForKey:@"alertTitle"]; |
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
var symbols = "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ".split(''); | |
var max_length = symbols.length; | |
for (var length = 1; length <= max_length; length++) { | |
var scombos = combinations(symbols, length); | |
for (var j = 0; j < scombos.length; j++) { | |
var word = scombos[j]; | |
console.log(word.join('')); | |
} | |
} |
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
mkdir gh-pages | |
cd gh-pages | |
git init | |
git remote add origin [email protected]:Cocoanetics/DTWebArchive.git | |
# add and commit files | |
git push origin master:gh-pages |
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
#import <dlfcn.h> | |
NSUInteger loadFonts() { | |
NSUInteger newFontCount = 0; | |
NSBundle *frameworkBundle = [NSBundle bundleWithIdentifier:@"com.apple.GraphicsServices"]; | |
const char *frameworkPath = [[frameworkBundle executablePath] UTF8String]; | |
if (frameworkPath) { | |
void *graphicsServices = dlopen(frameworkPath, RTLD_NOLOAD | RTLD_LAZY); | |
if (graphicsServices) { | |
BOOL (*GSFontAddFromFile)(const char *) = dlsym(graphicsServices, "GSFontAddFromFile"); |
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
#!/bin/sh | |
### BEGIN INIT INFO | |
# Provides: nginx | |
# Required-Start: $network $remote_fs $local_fs | |
# Required-Stop: $network $remote_fs $local_fs | |
# Default-Start: 2 3 4 5 | |
# Default-Stop: 0 1 6 | |
# Short-Description: Stop/start nginx | |
### END INIT INFO |
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
#! /bin/sh | |
### BEGIN INIT INFO | |
# Provides: redis-server | |
# Required-Start: $syslog $remote_fs | |
# Required-Stop: $syslog $remote_fs | |
# Should-Start: $local_fs | |
# Should-Stop: $local_fs | |
# Default-Start: 2 3 4 5 | |
# Default-Stop: 0 1 6 | |
# Short-Description: redis-server - Persistent key-value db |
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
God.watch do |w| | |
w.name = "nginx" | |
w.interval = 30.seconds | |
w.start = "/etc/init.d/nginx start" | |
w.stop = "/etc/init.d/nginx stop" | |
w.restart = "/etc/init.d/nginx restart" | |
w.start_grace = 10.seconds | |
w.restart_grace = 10.seconds | |
w.pid_file = "/var/run/nginx.pid" |
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
#!/bin/bash | |
# | |
# god Startup script for god (http://god.rubyforge.org) | |
# | |
# chkconfig: - 85 15 | |
# description: God is an easy to configure, easy to extend monitoring \ | |
# framework written in Ruby. | |
# | |
CONF_DIR=/usr/local/god |
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
worker_processes 4; | |
error_log /var/log/nginx/error.log warn; | |
pid /var/run/nginx.pid; | |
events { | |
worker_connections 1024; | |
} | |
http { |
OlderNewer