Skip to content

Instantly share code, notes, and snippets.

View jaridmargolin's full-sized avatar

Jarid Margolin jaridmargolin

View GitHub Profile
@kentcdodds
kentcdodds / README.md
Last active March 10, 2021 00:21
slice-js so far...

slice-js

So far...

A talk by @inconshreveable at The Strange Loop 2016 called "Idealized Commit Logs: Code Simplification via Program Slicing" about the amazing tools that can be built with program slicing inspired me to work on this project. Learn more about program slicing here.

This is actual output from slice-js (not yet open source), a program slicing tool that I'm working on right now. I can't wait to work out more kinks, make it more practically useful and show it to you all!

The match-sorter.js file is the transpiled CommonJS version of match-sorter and you can find that here.

@Restuta
Restuta / framework-sizes.md
Last active September 19, 2024 15:32
Sizes of JS frameworks, just minified + minified and gzipped, (React, Angular 2, Vue, Ember)

Below is the list of modern JS frameworks and almost frameworks – React, Vue, Angular, Ember and others.

All files were downloaded from https://cdnjs.com and named accordingly. Output from ls command is stripped out (irrelevant stuff)

As-is (minified)

$ ls -lhS
566K Jan 4 22:03 angular2.min.js
@garth
garth / Grunt-HTMLBars.js
Last active August 29, 2015 14:11
Grunt task to pre-compile HTMLBars templates
'use strict';
var fs = require('fs');
var path = require('path');
var templateCompiler = require('./bower_components/ember/ember-template-compiler');
var templatesPath = 'templates'
module.exports = function (grunt) {
grunt.initConfig({
@staltz
staltz / introrx.md
Last active November 14, 2024 11:27
The introduction to Reactive Programming you've been missing

Skyrocket Ventures, Inc 32123 Lindero Canyon Rd, Suite 200 Westlake Village, CA 91361

Kevin Burke 294 Barrington Lane Alamo, CA 94507

To whom it may concern: I am writing to inform you that I am planning to file a claim in California

@ismyrnow
ismyrnow / google-analytics-amd.js
Last active March 14, 2022 21:32
Google Analytics AMD Module
define(function (require) {
var module;
// Setup temporary Google Analytics objects.
window.GoogleAnalyticsObject = "ga";
window.ga = function () { (window.ga.q = window.ga.q || []).push(arguments); };
window.ga.l = 1 * new Date();
// Immediately add a pageview event to the queue.
@ShayDavidson
ShayDavidson / isc-marionette-0_index.md
Last active February 20, 2017 08:55
eBay Israel Social Center's Backbone Marionette Extensions.

eBay Israel Social Center's Marionette Extensions

This document is a summary of the convention we harnesed in the eBay Israel Social Center (ISC) for client-side development. It is built upon Backbone.Marionette and relies heavily on its Application, Module, Controller and AppRouter objects. We extended these classes with syntactic sugar, bootstrapping and other features we needed in order to simplify the way we work.

NOTE: The extensions were built up until v1.0.0-rc2 and do not include (yet) the Backbone update changes (we are still using EventBinders for example).

We used Marionette with our extensions to build the StubHub 'Go With Friends' service. The service allows users to arrange group events, invite friends, see who's in, and decide on the best tickets for everyone.

Some examples:

@keithamus
keithamus / example_code.js
Created November 22, 2012 12:20
How to do Dependency Injection in RequireJS?
define([], function () {
return function HypotheticalHelperMethod() {
doSomeOtherStuff();
}
});
define(["helperMethod"], function (helperMethod) {
@michaelcox
michaelcox / SpecRunner.js
Last active October 12, 2024 17:11
Browser Unit Testing with Backbone Mocha Chai and RequireJS
require.config({
baseUrl: '/backbone-tests/',
paths: {
'jquery' : '/app/libs/jquery',
'underscore' : '/app/libs/underscore',
'backbone' : '/app/libs/backbone',
'mocha' : 'libs/mocha',
'chai' : 'libs/chai',
'chai-jquery' : 'libs/chai-jquery',
'models' : '/app/models'
@ShirtlessKirk
ShirtlessKirk / luhn.js
Last active August 27, 2024 05:35
Luhn validation algorithm
/**
* Luhn algorithm in JavaScript: validate credit card number supplied as string of numbers
* @author ShirtlessKirk. Copyright (c) 2012.
* @license WTFPL (http://www.wtfpl.net/txt/copying)
*/
var luhnChk = (function (arr) {
return function (ccNum) {
var
len = ccNum.length,
bit = 1,