Skip to content

Instantly share code, notes, and snippets.

View iamricky's full-sized avatar

Ricky iamricky

View GitHub Profile
http://nicksda.apotomo.de/2011/10/rails-misapprehensions-helpers-are-shit
@iamricky
iamricky / RegExpPatterns.md
Created August 27, 2014 01:27
RegExp in JS

RegExp

var pattern = new RegExp('javascript','i');
//or 
var pattern = /javascript/i;

Patterns can be used as follows

@iamricky
iamricky / inheritance.md
Created August 27, 2014 01:45
Inheritance in JS

Inheritance

function Animal(name){
   this.name = name;
}
Animal.prototype.talk = function(){
   console.log(this.phrase);
}
@iamricky
iamricky / collection-parse.md
Created August 27, 2014 01:47
Parsing the Response from the Server in Backbone.js

Using collection.parse

(function () {
    //Create a Car Collection
	var CarCollection = Backbone.Collection.extend({
		
		//Specify REST URL
		url: 'http://localhost:8500/rest/Car/CarService',
		initialize: function () {
@iamricky
iamricky / README.md
Created October 3, 2015 22:31 — forked from yorkxin/README.md
Notes on Paul Irish's "Things I learned from the jQuery source" casts.

Notes on Paul Irish's "Things I learned from the jQuery source" casts

I watched these videos on 2012/12/14. Today's jQuery version is 1.8.3. So there might be some differences from the original video. I've briefly noted some of the differences between what described in the video and the current stable release. Most code he desribed can be found easily in speed/jquery-basic.js (1.4.2).

Episode 1

2010-06-14 (jQuery 1.4.1)

const flatten = items => {
return [].concat(...items.map(value => {
if (Array.isArray(value)) {
return flatten(value);
}
return value
}));
};
@iamricky
iamricky / introrx.md
Created February 5, 2020 06:11 — forked from staltz/introrx.md
The introduction to Reactive Programming you've been missing
/* Helper buddy for removing async/await try/catch litter 🗑 */
function O_o(promise) {
return promise.then(data => {
if (data instanceof Error) return [data]
return [null, data]
}).catch(err => [err])
}
/* Look ma, no try/catch */
async function usageExample(params) {

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

@iamricky
iamricky / falsehoods-programming-time-list.md
Created April 4, 2022 13:29 — forked from timvisee/falsehoods-programming-time-list.md
Falsehoods programmers believe about time, in a single list

Falsehoods programmers believe about time

This is a compiled list of falsehoods programmers tend to believe about working with time.

Don't re-invent a date time library yourself. If you think you understand everything about time, you're probably doing it wrong.

Falsehoods

  • There are always 24 hours in a day.
  • February is always 28 days long.
  • Any 24-hour period will always begin and end in the same day (or week, or month).