Skip to content

Instantly share code, notes, and snippets.

@imjasonh
imjasonh / markdown.css
Last active January 3, 2025 20:15
Render Markdown as unrendered Markdown (see http://jsbin.com/huwosomawo)
* {
font-size: 12pt;
font-family: monospace;
font-weight: normal;
font-style: normal;
text-decoration: none;
color: black;
cursor: default;
}
@paulirish
paulirish / bling.js
Last active May 10, 2025 11:02
bling dot js
/* bling.js */
window.$ = document.querySelector.bind(document);
window.$$ = document.querySelectorAll.bind(document);
Node.prototype.on = window.on = function(name, fn) { this.addEventListener(name, fn); };
NodeList.prototype.__proto__ = Array.prototype;
NodeList.prototype.on = function(name, fn) { this.forEach((elem) => elem.on(name, fn)); };
@mattpodwysocki
mattpodwysocki / users.html
Created April 15, 2015 21:25
Getting a list of users with RxJS and JSX
<!DOCTYPE html>
<html>
<head>
<meta http-equiv='Content-type' content='text/html; charset=utf-8'>
<title>Basic Example with JSX</title>
<link rel="stylesheet" href="base.css" />
</head>
<body>
<h1>ReactJs + RxJs</h1>
<div id="container">
@mattpodwysocki
mattpodwysocki / eventaggregator.js
Last active June 13, 2018 00:30
Example of an event aggregator using RxJS
var Rx = require('rx');
function EventAggregator() {
this._subject = new Rx.Subject(); // Can be ReplaySubject too
}
EventAggregator.prototype.publish = function (type, data) {
this._subject.onNext( { type: type, data: data });
};
@fumieval
fumieval / FBX.hs
Created April 28, 2015 07:50
FBX 7.4 parser
{-# LANGUAGE LambdaCase, TypeFamilies, DataKinds, TypeOperators, FlexibleContexts, OverloadedStrings, StandaloneDeriving #-}
module Codec.Container.FBX where
import qualified Data.Vector.Unboxed as UV
import Data.Binary
import Data.Binary.Get
import Data.Binary.Put
import Data.Int
import Data.ByteString (ByteString)
import qualified Data.ByteString as BS
@janecakemaster
janecakemaster / empirejs.md
Last active August 29, 2015 14:20
empire js notes 2015

EmpireJS 2015 - takeaways and resources

Day 1

Rudy Jahchan - Getting Started in VR with JS (art, vr, physical)

  • slides
  • it would be cool to get our hands on google cardboard and experiment with 3d-ish video!
@PatrickJS
PatrickJS / rxPipeRegistry.ts
Last active November 12, 2015 16:51
rx support for Angular 2 Async Pipe
/// <reference path="../../typings/tsd.d.ts" />
///
import {PipeFactory} from 'angular2/src/change_detection/pipes/pipe';
import {async} from 'angular2/src/change_detection/change_detection';
import {NullPipeFactory, Pipe, PipeRegistry, defaultPipes} from 'angular2/change_detection';
import {bind} from 'angular2/di';
import {ObservablePipe} from 'angular2/pipes';
import * as Rx from 'rx';
export function isObservable(obs) {
@acdlite
acdlite / flux.js
Last active October 7, 2021 17:19
A Redux-like Flux implementation in <75 lines of code
/**
* Basic proof of concept.
* - Hot reloadable
* - Stateless stores
* - Stores and action creators interoperable with Redux.
*/
import React, { Component } from 'react';
export default function dispatch(store, atom, action) {
@chpatrick
chpatrick / lazy-parsers.hs
Last active December 18, 2017 00:39
Regex-style lazy parsers
{-# LANGUAGE FlexibleInstances, GeneralizedNewtypeDeriving, PatternSynonyms, RankNTypes #-}
import Control.Applicative
import Control.Monad.Codensity
import Control.Monad.Trans
import Text.Parser.Combinators
import Text.Parser.Char
import qualified Data.Attoparsec.ByteString.Char8 as AP
@Falconerd
Falconerd / gulpfile.js
Last active April 10, 2019 17:16
Gulp + Watchify + Babelify + BrowserSync
/**
* This gulpfile will copy static libraries and a index.html file as well as
* merge, babelify and uglify the rest of the javascript project.
*
* TODO:
* - Separate media, libs and src with different watchers.
* - Media and libs should only be copied to dist if they are different sizes.
*
* The expected project is to be laid out as such:
*