Skip to content

Instantly share code, notes, and snippets.

@funyx
funyx / sails git stage porduction
Last active May 23, 2016 13:57
sails app production stage (Ubuntu 14+)
Follow the instructions
@funyx
funyx / From Scratch
Created November 8, 2015 17:02
sails app production stage (Ubuntu 14+)
$ locale //output must not have empty records
// TODO:
// Check that you have the locales package installed
dpkg -l locales
xCode 6+ needs resource path :
-> Project/Build Settings/Search Paths/Header Search Paths
$(OBJROOT)/UninstalledProducts/$(PLATFORM_NAME)/include
@funyx
funyx / safeApply ng
Last active November 8, 2015 16:52 — forked from siongui/gist:4969449
AngularJS safe $apply (prevent "Error: $apply already in progress")
$scope.safeApply = function(fn) {
var phase = this.$root.$$phase;
if(phase == '$apply' || phase == '$digest')
this.$eval(fn);
else
this.$apply(fn);
};
// OR
@funyx
funyx / info.plist
Created October 27, 2015 09:34 — forked from mlynch/info.plist
Disable App Transport Security in iOS 9
<!--
This disables app transport security and allows non-HTTPS requests.
Note: it is not recommended to use non-HTTPS requests for sensitive data. A better
approach is to fix the non-secure resources. However, this patch will work in a pinch.
To apply the fix in your Ionic/Cordova app, edit the file located here:
platforms/ios/MyApp/MyApp-Info.plist
And add this XML right before the end of the file inside of the last </dict> entry:
@funyx
funyx / flightplan-deploy.md
Last active August 29, 2015 14:28 — forked from learncodeacademy/flightplan-deploy.md
Deploy Node.js Apps with Flightplan

##Setup your server (this would ideally be done with automated provisioning)

  • add a deploy user with password-less ssh see this gist
  • install forever npm install -g forever

##Install flightplan

  • npm install -g flightplan
  • in your project folder npm install flightplan --save-dev
  • create a flightplan.js file
@funyx
funyx / redis
Last active August 29, 2015 14:22
#! /bin/sh
### BEGIN INIT INFO
# Provides: redis-server
# Required-Start: $syslog
# Required-Stop: $syslog
# 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