Skip to content

Instantly share code, notes, and snippets.

@jamesmbeams
jamesmbeams / cron_setup.sh
Created July 18, 2017 14:24
ElasticBeanstalk Cron setup w/ script to determine auto scaling group leader
#read cron command into temporary file
echo "0 2 * * * . /opt/elasticbeanstalk/support/envvars; /var/app/current/path/to/command" > /tmp/mycron
#install new cron file
crontab /tmp/mycron
#delete unwanted mycron file
rm /tmp/mycron
@jamesmbeams
jamesmbeams / gist:5156859
Created March 13, 2013 22:10
Prevent "Origin null is not allowed by Access-Control-Allow-Origin" when making an AJAX request to an express server from a file://
app.use(function(req, res, next) {
res.header("Access-Control-Allow-Origin", "*");
next();
});
@jamesmbeams
jamesmbeams / gist:5155230
Created March 13, 2013 19:20
To allow Cordova (iOS) to connect to HTTPS with a self signed certificate, paste this at the bottom of AppDelegate.m NOTE: Only for testing, remember to remove it before submitting to the App Store, as I hear it could cause the app to be rejected.
@implementation NSURLRequest (ServiceClient)
+ (BOOL) allowsAnyHTTPSCertificateForHost:(NSString *) host
{
return YES;
}
@end