Skip to content

Instantly share code, notes, and snippets.

View franklinjavier's full-sized avatar

Frank franklinjavier

View GitHub Profile
{
"always_show_minimap_viewport": false,
"bold_folder_labels": false,
"color_scheme": "Packages/User/SublimeLinter/Material-Theme-Darker-OceanicNext (SL).tmTheme",
"ensure_newline_at_eof_on_save": true,
"extra_file_exclude_patterns":
[
"*.pyc",
"*.pyo",
"*.exe",
@franklinjavier
franklinjavier / serviceworker_wk.js
Created September 1, 2016 15:31 — forked from kimhogeling/serviceworker_wk.js
Service Worker of the shopping24 hacking days wohnklamotte prototype
/**
* KH: Warning! This is part of a prototype made during our early 2016 hacking days and is not suitable for production!
*/
const VERSION = 's24-wokl-social-v6'
const CACHE_FILES = [
'/',
'/index.html',
'/public/css/card.css',
(function() {
'use strict';
angular
.module('store')
.controller('StoreController', StoreController);
/*@ngInject*/
function StoreController() {
var vm = this;
@franklinjavier
franklinjavier / gist:91607963994b04b29ef9
Created March 22, 2016 03:34
Walmart Mobile node.js Setup

Overview

We run multiple server processes in two data centers. Each process listens on two ports, one for HTTP and one for HTTPS. HTTPS is terminated by Apache prior to reaching node.js. HTTP goes directly from the client to node.js (through a master load balancer). We do not use clusters. We slice our physical servers into thin virtual machines running SmartOS, each with about 3GB of memory designed for a single node.js process.

Our node.js servers are hapi.js servers using the composer functionality and plugins architecture. We have three sets of plugins loaded: mobile web front end experience (single page app), legacy API reverse proxy, and monitoring.

We also serve original node.js services off another server zone which runs closed source plugins using hapi.

Analytics

@franklinjavier
franklinjavier / birthdays-of-month.js
Last active March 21, 2016 02:11
Get birthdays of the month
User
.find({
birthdate: { $exists: true },
$where: 'return this.birthdate.getMonth()+1 === 1' // january
})
.exec(function(err, users) {
console.log(err, users);
});
@franklinjavier
franklinjavier / form.html
Created March 12, 2016 16:25
POC with ngMessages
<form name="vm.form"
ng-submit="vm.form.$valid && vm.createRetailer()"
novalidate>
<div class="form-group">
<label class="control-label" for="email">E-mail <i class="fa fa-asterisk"></i></label>
<input class="form-control" id="email" type="email" name="email"
ng-model="vm.data.email" required autocomplete="off">
<span ng-messages="vm.form.email.$error"
{
"always_show_minimap_viewport": false,
"bold_folder_labels": false,
"color_scheme": "Packages/Material Theme/schemes/Material-Theme-Darker-OceanicNext.tmTheme",
"ensure_newline_at_eof_on_save": true,
"extra_file_exclude_patterns":
[
"*.pyc",
"*.pyo",
"*.exe",
@franklinjavier
franklinjavier / ls.sh
Created February 25, 2016 01:50
React boilerplates (React Fatigue Dev)
franklinjavier in ~/react-boilerplates λ ll
87 franklinjavier 2,9K 22 Fev 22:12 .
94 franklinjavier 3,1K 24 Fev 22:46 ..
1 franklinjavier 10K 28 Jan 00:01 .DS_Store
9 franklinjavier 306B 29 Ago 18:26 Maximus
15 franklinjavier 510B 11 Set 00:13 PnLive
12 franklinjavier 408B 20 Out 00:36 academy-webdev-bootstrap
11 franklinjavier 374B 4 Nov 00:37 advanced-react
30 franklinjavier 1,0K 12 Out 17:30 alt
9 franklinjavier 306B 29 Ago 17:34 babel
@franklinjavier
franklinjavier / frp.md
Created February 9, 2016 17:23 — forked from ohanhi/frp.md
Learning FP the hard way: Experiences on the Elm language

Learning FP the hard way: Experiences on the Elm language

by Ossi Hanhinen, @ohanhi

with the support of Futurice 💚.

Licensed under CC BY 4.0.

Foreword

@franklinjavier
franklinjavier / rating.js
Created January 23, 2016 15:31
Rating in angularjs
angular.module('plunker', [])
.directive('rating', function() {
return {
scope: {
rate: '=',
onUpdate: '&'
},
templateUrl: 'rating.html',
link: function(scope, element, attrs) {