Skip to content

Instantly share code, notes, and snippets.

View lykmapipo's full-sized avatar

lally elias lykmapipo

View GitHub Profile
@chitchcock
chitchcock / 20111011_SteveYeggeGooglePlatformRant.md
Created October 12, 2011 15:53
Stevey's Google Platforms Rant

Stevey's Google Platforms Rant

I was at Amazon for about six and a half years, and now I've been at Google for that long. One thing that struck me immediately about the two companies -- an impression that has been reinforced almost daily -- is that Amazon does everything wrong, and Google does everything right. Sure, it's a sweeping generalization, but a surprisingly accurate one. It's pretty crazy. There are probably a hundred or even two hundred different ways you can compare the two companies, and Google is superior in all but three of them, if I recall correctly. I actually did a spreadsheet at one point but Legal wouldn't let me show it to anyone, even though recruiting loved it.

I mean, just to give you a very brief taste: Amazon's recruiting process is fundamentally flawed by having teams hire for themselves, so their hiring bar is incredibly inconsistent across teams, despite various efforts they've made to level it out. And their operations are a mess; they don't real

@ticky
ticky / browser-regex.md
Last active October 19, 2023 23:13
Browser and Version regex

Browser and Version Regular Expression 2.0

(MSIE|(?!Gecko.+)Firefox|(?!AppleWebKit.+Chrome.+)Safari|(?!AppleWebKit.+)Chrome|AppleWebKit(?!.+Chrome|.+Safari)|Gecko(?!.+Firefox))(?: |\/)([\d\.apre]+)

This regular expression is capable of retrieving the browser and version for the following browsers;

  • Internet Explorer
  • Firefox (INCLUDING alpha and "pre" versions)
  • Other browsers reporting a "Gecko" version in their user agent
  • Chrome
  • Safari
  • Other browsers reporting an "AppleWebKit" version in their user agent
@niravmehta
niravmehta / kue_cleanup.js
Created July 30, 2013 11:57
Cleanup script for Kue job queueing system in Node.js. Deletes failed, active and completed jobs after specified time. Can run on command line directly with "node kue_cleanup". Requires Kue installed :-)
var kue = require('kue'),
jobs = kue.createQueue(),
util = require('util'),
noop = function() {};
jobs.CLEANUP_MAX_FAILED_TIME = 30 * 24 * 60 * 60 * 1000; // 30 days
jobs.CLEANUP_MAX_ACTIVE_TIME = 1 * 24 * 60 * 60 * 1000; // 1 day
jobs.CLEANUP_MAX_COMPLETE_TIME = 5 * 24 * 60 * 60 * 1000; // 5 days
jobs.CLEANUP_INTERVAL = 5 * 60 * 1000; // 5 minutes
@demisx
demisx / angularjs-providers-explained.md
Last active May 17, 2024 03:38
AngularJS Providers: Constant/Value/Service/Factory/Decorator/Provider
Provider Singleton Instantiable Configurable
Constant Yes No No
Value Yes No No
Service Yes No No
Factory Yes Yes No
Decorator Yes No? No
Provider Yes Yes Yes

Constant

@mdunisch
mdunisch / How you get Sail.js running on Openshift.md
Last active July 13, 2023 14:51
Get Sails.js running on Openshift

#How you get Sail.js running on Openshift#

This instruction is tested with:

  • Sails.js v0.9.16
  • Node.js 0.10 on Openshift ( 05 May 2014)

###1) package.json

If you use the package.json build by sails new Projectname than you have to add a few fields for openshift – so the server can start you app automatically. Sails uses Grunt to build minify css/js and so on. Openshift dont have grunt installed so you have to add this also.

@mlynch
mlynch / directive.markdown
Last active July 31, 2017 14:37
Making of an AngularJS Directive

A while back I made a quick AngularJS directive for Bootstrap 3 Tooltips. I wanted to be able to specify tooltips on any element like this:

<button title="Settings" data-placement="bottom" data-delay="500"
data-toggle="tooltip"><i class="icon ion-gear"></i></button>

But I wanted to be able to do it without having to call $([data-toggle="tooltip"]').tooltip() every time I loaded a new page with tooltips, which is what you'd have to do if you were using vanilla jQuery and Bootstrap without something like Angular.

I built a really simple directive that worked perfectly, and I realized this was a perfect example of creating a simple custom directive that makes your life so much easier.

@jmdobry
jmdobry / DSCustomAdapter.js
Created September 25, 2014 15:53
Creating custom adapters for angular-data
angular.module('myApp').provider('DSCustomAdapter', function () {
'use strict';
var defaults = this.defaults = {
queryTransform: function (resourceName, params) {
return params;
}
};
@jmdobry
jmdobry / app.js
Last active May 16, 2018 18:16
js-data + js-data-firebase + js-data-localstorage
var fb = new DSFirebaseAdapter({
basePath: 'https://my-app.firebase.io'
});
var ls = new DSLocalStorageAdapter();
var store = new JSData.DS({
// try firebase first, otherwise try offline data
fallbackAdapters: ['fb', 'ls'],
// After creating an item, sync it to localStorage
@lykmapipo
lykmapipo / nodejs_env_setup.md
Last active August 29, 2015 14:18
Nodejs Environment Setup

nodejs development environment setup

Update ubuntu

$ sudo apt-get update

Install curl

$ sudo apt get install curl
@lykmapipo
lykmapipo / mongoose_single_document_inheritance.js
Last active August 29, 2015 14:20
Mongoose Single Document Inheritance
'use strict';
//dependencies
var mongoose = require('mongoose');
var util = require('util');
var Schema = mongoose.Schema;
var async = require('async');
//Base Journal Entry Schema
function JournalEntry() {