Skip to content

Instantly share code, notes, and snippets.

@bmkmanoj
bmkmanoj / permutations.js
Created February 6, 2017 20:59 — forked from mitrakmt/permutations.js
All permutations of a set interview challenge.
function getAllPermutations(string) {
var results = [];
if (string.length === 1) {
results.push(string);
return results;
}
for (var i = 0; i < string.length; i++) {
var firstChar = string[i];
@bmkmanoj
bmkmanoj / CH4.html
Created January 22, 2017 07:56 — forked from dd3141592/CH4.html
crib notes and some examples from "JavaScript Patterns" by Stoyan Stefanov //Chapter 4 Functions
<!DOCTYPE html>
<html>
<head>
<meta name="CH 4 functions" content="Javascript Patterns">
<meta charset="utf-8">
<title>JS Bin</title>
</headJavascript patterns
<body>
Javascript Patterns, by Stoyan Stefanov (O'Reilly). Copyright 2010 Yahoo!, Inc., 9780596806750.
<script id="jsbin-javascript">
(function($, window, undefined) {
var InfiniteScroll = function() {
this.initialize = function() {
this.setupEvents();
};
this.setupEvents = function() {
$(window).on(
'scroll',
this.handleScroll.bind(this)
@bmkmanoj
bmkmanoj / main.js
Created January 15, 2017 05:35 — forked from cem2ran/main.js
React Getting Started - How it should be!
import React from 'react'
import ReactDOM from 'react-dom'
const Hello = ({name}) => <h1>Hello {name}!</h1>
ReactDOM.render(
<Hello name={"vjeux"}/>,
document.body.appendChild(document.createElement("div"))
)
@bmkmanoj
bmkmanoj / frontendDevlopmentBookmarks.md
Created January 10, 2017 17:29 — forked from dypsilon/frontendDevlopmentBookmarks.md
A badass list of frontend development resources I collected over time.
@bmkmanoj
bmkmanoj / ie-css-hacks.css
Created January 9, 2017 15:50 — forked from necolas/ie-css-hacks.css
IE CSS hacks
/*
* Property prefix hacks
*/
/* IE6 only - any combination of these characters */
_ - £ ¬ ¦
/* IE6/7 only - any combination of these characters */
@bmkmanoj
bmkmanoj / bloop.js
Created January 9, 2017 15:07 — forked from jlongster/bloop.js
bloop
(function() {
// Do not use this library. This is just a fun example to prove a
// point.
var Bloop = window.Bloop = {};
var mountId = 0;
function newMountId() {
return mountId++;
}
@bmkmanoj
bmkmanoj / simple-redux.js
Created August 20, 2016 20:23 — forked from conorhastings/simple-redux.js
A very (read: don't do this) simple implementation of redux
/*
* The reason for this is just a thought exercise
* often people(myself super included) are so confused
* when trying something new, but breaking it down
* to it's simplest existence can be the best way to understand
*/
function createStore(reducer, initState) {
let state = initState;
let subscribers = [];
@bmkmanoj
bmkmanoj / flux-reference.js
Created August 20, 2016 20:15 — forked from vslinko/flux-reference.js
minimal flux
/* @flow */
type State = Object
type Action = {type: string | void}
type AsyncAction = (performAction: FluxPerformFunction, state: State) => void
type ActionCreator = () => Action | AsyncAction
type StoreFunction = (state: State, action: Action) => State
@bmkmanoj
bmkmanoj / 0_reuse_code.js
Created March 30, 2016 00:25
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console