Skip to content

Instantly share code, notes, and snippets.

View nervetattoo's full-sized avatar

Raymond Julin nervetattoo

View GitHub Profile
@ericelliott
ericelliott / essential-javascript-links.md
Last active April 22, 2024 10:15
Essential JavaScript Links
@rgaidot
rgaidot / Awesome-Electronic-and-Hardware-platform.md
Last active May 8, 2022 02:52
Awesome Electronic and Hardware platform
@airportyh
airportyh / jsconf_slides_codes_and_notes.md
Last active June 19, 2017 20:51
JSConf 2014 Slides, Codes and Notes.

JSConf Slides, Codes and Notes

These are all the JSConf 2014 slides, codes, and notes I was able to cull together from twitter. Thanks to the speakers who posted them and thanks to @chantastic for posting his wonderful notes.

Modular frontend with NPM - Jake Verbaten (@Raynos)

@WebReflection
WebReflection / Delayed.js
Last active March 4, 2020 23:39
whenever you need to execute something after an interaction that might happen many times (panning, scrolling, etc) … this simple mechanism makes simple to execute that maybe expensive operations only once when things are "quiet" and never before or in the middle, if an action start as "start panning" would be is fired and it's calling the clear(…
/*jslint browser: true, indent: 2 */
var Delayed = (function (delay) {
/*! Andrea Giammarchi - Mit Style License */
// https://gist.github.com/WebReflection/7286687
'use strict';
// method shared across all delayed wrappers
function clear() {
@wycats
wycats / HTMLBars Plan.md
Last active December 18, 2015 15:59
HTMLBars Binding

HTMLBars serves as a polyfill for a native implement of node.bind.

Instead of letting the browser parse the HTML and generate nodes, which leaves us at the mercy of the limitations of the parser, HTMLBars implements an HTML parser and generates the nodes itself.

As HTMLBars generates the nodes, it calls into node.bind if it detects mustache syntax.

Open questions:

  • MDV "syntaxes"
@funkatron
funkatron / testable.html
Last active December 15, 2015 00:09
Showing a refactor to improve testability of a JavaScript app's global class. Before, we were doing a bunch of things inside one scope, and doing all the setup + kickstarting the app in the same scope. By breaking things out into separate chunks via function definitions, we can test each piece of setup individually without kickstarting the entir…
<script type="text/javascript" src="/static/js/testable_app_run.js"></script>
@dunhamsteve
dunhamsteve / table.html
Last active July 17, 2022 17:34
Example of a scrollable table that only renders visible rows
<!-- This code is public domain, share and enjoy. -->
<html>
<style type="text/css" media="screen">
#table {
position: absolute;
top: 30px;
bottom: 0;
left: 10px;
right: 10px;
}
@matthewp
matthewp / rel-template.js
Created June 19, 2012 19:08
Synchronous loading of templates in a link tag.
(function() {
"use strict";
Object.defineProperty(HTMLLinkElement.prototype, 'template', {
get: function() {
if(!/template/i.test(this.rel)) {
return "";
}
var req = new XMLHttpRequest();
@jlong
jlong / uri.js
Created April 20, 2012 13:29
URI Parsing with Javascript
var parser = document.createElement('a');
parser.href = "http://example.com:3000/pathname/?search=test#hash";
parser.protocol; // => "http:"
parser.hostname; // => "example.com"
parser.port; // => "3000"
parser.pathname; // => "/pathname/"
parser.search; // => "?search=test"
parser.hash; // => "#hash"
parser.host; // => "example.com:3000"
@spacemonkey
spacemonkey / connections.php
Created November 24, 2011 12:22
Example for connecting Lithium apps to a MongoDB replica set
/**
* Example of a production database called "db_prod" connecting to a replica set
* running on two systems, "db1" and "db2" with the replica set name of "prod_01".
*
* This setup assumes that you're running a recent version of MongoDB as well as
* the PHP extension.
**/
Connections::add('default', array(
'production' => array(
'type' => 'MongoDb',