Skip to content

Instantly share code, notes, and snippets.

@phund
phund / gist:5daca82379d38ddad201
Created February 19, 2016 02:53 — forked from weberste/gist:354a3f0a9ea58e0ea0de
Dates only with Angular-UI Bootstrap datepicker
app.directive('datepickerLocaldate', ['$parse', function ($parse) {
var directive = {
restrict: 'A',
require: ['ngModel'],
link: link
};
return directive;
function link(scope, element, attr, ctrls) {
var ngModelController = ctrls[0];

How to get facebook login working with Meteor and Cordova on iOS

Step 1: Make your local dev site internet accessible

Because there is an issue with OAuth2 login and localhost development, you currently have to deploy your meteor site to be able to test the Facebook login. A nice little workaround for this is to make the local instance of meteor accessible externally.

There is a great online guide for setting up port forwarding with your router and you can check your public external IP here.

For example, If you have an Apple router, simply open up Airport Utility on your Mac and click edit on your router, then go to the Network tab. Under Port Settings click the + icon and select Personal Web Sharing, setting all of the public and private ports to 3000. Make sure the private IP is set to your current computer IP.

@phund
phund / build-release.sh
Created June 15, 2016 09:59 — forked from rknell/build-release.sh
Build Android Release apk from Cordova /CLI
#!/bin/bash
#Thanks to this page: http://chris-allen-lane.com/2012/12/phonegap-compiling-a-release-apk-without-using-phonegap-build/
#USAGE!
# 1. Replace <AndroidKeyName> with the filename of the keyfile generated (see url)
# 2. Replace <ProjectName> with the project name in the generated file form cordova, see path/to/my/project/platforms/android/bin and look for an APK if you need help
# 3. Replace <AndroidKeyNameAlias> from the alias used when generating the key (see url again!)
# 4. Edit path/to/my/project/platforms/android/AndroidManifest.xml and change "debuggable=false" (search for it!)
# 5. Check path/to/my/project/Release/android for your sparkling new apk!
#
# This worked and was uploadable to the google play store.
@phund
phund / deploy.rb
Created August 30, 2016 07:57 — forked from thefron/deploy.rb
Node.js deploy /w Capistrano 3
# config/deploy.rb
# config valid only for Capistrano 3.1
lock '3.1.0'
set :application, 'my_app'
set :repo_url, 'git@github.com:USER/my_app.git'
# Default deploy_to directory is /var/www/my_app
set :deploy_to, '/var/node/my_app'
@phund
phund / README
Created August 30, 2016 07:58 — forked from harrylove/README
Capistrano deploy script for Meteor on AWS running RedHat
This assumes you've already set up your instance with node, npm, forever, mongodb, configured ports, and have optionally added a web server like nginx to proxy access to meteor.
Local
1. Install Ruby
2. gem install capistrano
3. cd /your/meteor/project
4. capify .
5. edit config/deploy.rb as needed with below
AWS
@phund
phund / deploy.rb
Created August 30, 2016 07:58 — forked from fightingtheboss/deploy.rb
Capistrano deploy script for deploying multiple app instances of a Meteor app to a single private VPS on different ports.
# This deploy script takes a parameter to define the number of instances to deploy (default is 1)
# ex: cap deploy -s instances=3
set :application, "YOUR_APP_NAME"
set :repository, "git@YOUR_GIT_REPOT.git"
set :scm, :git
set :deploy_via, :remote_cache
set :user, "deploy"
set :deploy_to, "/home/deploy/www/#{application}"
@phund
phund / nodejs-angularjs-common-modules.md
Created October 18, 2016 07:46 — forked from sevcsik/nodejs-angularjs-common-modules.md
Sharing modules between NodeJS and AngularJS

They say that one of the pros of NodeJS is that you use the same language on the back-end and the front-end, so it's easy to share code between them. This sounds great in theory, but in practice the synchronous dependency handling in NodeJS works completely different than any client-side frameworks (which are asynchronous).

Usually that means that you end up copy-pasting your code between your NodeJS sources and your client-side sources, or you use some tool like Browserify, which is brilliant, but they add an extra step in the build process and most likely will conflict with the dependency handling of the framework of your choice (like AnularJS DI). I couldn't look in the mirror if I would call that code sharing.

Fortunately, with a couple of lines of boilerplate code, you can write a module which works in NodeJS and AngularJS as well without any modification.

No globals in the front-end, and dependencies will work. The isNode and isAngular va

@phund
phund / Installing Graphics Magic
Created March 30, 2017 09:59 — forked from abernardobr/Installing Graphics Magic
How to install Graphics Magick
## On Windows:
``http://www.graphicsmagick.org/INSTALL-windows.html``
## On the Mac:
``brew install graphicsmagick``
## On the Joyent box:
```

FWIW: I didn't produce the content present here. I've just copy-pasted it from somewhere over the Internet, but I cannot remember exactly the original source. I was also not able to find the author's name, so I cannot give him/her the proper credit.


Effective Engineer - Notes

What's an Effective Engineer?

@phund
phund / benchmark.rb
Created July 19, 2018 08:29 — forked from hakanensari/benchmark.rb
PostgreSQL update strategies in and around Rails
require 'active_record'
require 'activerecord-import'
require 'benchmark'
require 'pg'
include ActiveRecord
Base.establish_connection adapter: 'postgresql',
encoding: 'unicode',
pool: 5,