Skip to content

Instantly share code, notes, and snippets.


Jorge Olaf Erlandsen olaferlandsen

View GitHub Profile
olaferlandsen / app.js
Created Jan 14, 2019 — forked from daffl/app.js
Feathers Buzzard improved real-time event filtering dispatchers
View app.js
app.service('messages').dispatch('eventname', (message, hook) => {
// Just dispatch to one user
if(message.isPrivate) {
// Returning falsy or nothing will do nothing
// Send to a certain room
View Byte Formatting for Google
View gist:6b643b9a3945458b7eba1acdb4284e54
upstream app_server {
server app_react:3000 max_fails=3 fail_timeout=30s;
upstream api_server {
server api_feathers:3040 max_fails=3 fail_timeout=30s;
olaferlandsen /
Last active Nov 25, 2018
Ejercicios base de datos
olaferlandsen / ObjectSchema.js
Last active May 7, 2018
Create, validate and use "Object Schemas"
View ObjectSchema.js
window.ObjectSchema = function (value, options, throwError) {
var regexpArray = /(array|\[([\]]+)\])/i;
var finalObject = {};
if (typeof options !== "object" || options === null) return false;
if (typeof value !== "object" || value === null) return false;
var defaultOptions = {type : "string", defaultValue : null, nullable : false};
for (var property in value) {
var v = value[property], o = options[property];
if (property in options) {
o = Object.assign(defaultOptions, o || {});
olaferlandsen / gist:dfea2ca397af198f78daaf52eaf21978
Last active Apr 16, 2018
Install node & seting ionic on OSX
View gist:dfea2ca397af198f78daaf52eaf21978
brew install nvm
mkdir ~/.nvm
export NVM_DIR="$HOME/.nvm"
. "/usr/local/opt/nvm/"
nvm install node // download, compile and install the latest version of node
// install cordova, ionic and typescript
npm install -g cordova ionic typescript
// setting ios envivorment
npm install -gf ios-deploy --unsafe-perm=true
olaferlandsen /
Last active Apr 21, 2018
Uninstall completely nodejs from OSX
sudo rm -rf /usr/local/lib/node_modules
sudo rm -rf /usr/local/include/node_modules
sudo rm -rf /usr/local/bin/node
sudo rm -rf /usr/local/bin/node-debug
sudo rm -rf /usr/local/bin/node-gyp
sudo rm -rf ~/.npmrc
sudo rm -rf ~/.npm
sudo rm -rf ~/.node-gyp
sudo rm -rf ~/.node_repl_history
sudo rm -rf ~/node_modules
olaferlandsen / app.module.ts
Last active Oct 20, 2017
Directiva para formatear RUT en Ionic2
View app.module.ts
declarations: [
olaferlandsen /
Created Mar 15, 2017 — forked from patrickhammond/
Easily setup an Android development environment on a Mac

Here is a high level overview for what you need to do to get most of an Android environment setup and maintained.

Prerequisites (for Homebrew at a minimum, lots of other tools need these too):

  • XCode is installed (via the App Store)
  • XCode command line tools are installed (xcode-select --install will prompt up a dialog)
  • Java

Install Homebrew:

ruby -e "$(curl -fsSL"
olaferlandsen / ngNumber.js
Last active Dec 16, 2016
ngNumber - Simple and powerful directive for allow only numbers on text input.
View ngNumber.js
* How to use it?
* You only need set 'ng-number' attribute on you input like
* <input ng-model="myModel" ng-number>
* How to integrate?
* You need copy this code and paste after you module definition on you Angular app.
* Example:
* module('controllers', [])