Skip to content

Instantly share code, notes, and snippets.

/*
Step 1: Go get the User CSS Chrome Extension
(because chrome lacks a native user stylesheet tool)
https://chrome.google.com/webstore/detail/user-css/okpjlejfhacmgjkmknjhadmkdbcldfcb
Step 2: Go to LinkedIn, open the tool, and paste the
contents of this Gist
You can't stop people from posting terrible parables,
but if that's all your feed has become, then having
@jakobo
jakobo / gulpfile.js
Last active August 29, 2015 13:56
Async Tasks and Orchestrator
// I'm pretty sure this is a bad idea
setImmediate(function() {
gulp.task('later', function() {
gulp.src('**/*.txt')
.pipe(gulp.dest('output/'))
});
});
// but I really want to...
fs.readFile('some-other-tool.json', function(err, data) {
@jakobo
jakobo / inject.diff
Last active December 26, 2015 09:09
diff --git a/src/requirecontext.js b/src/requirecontext.js
index 14accf0..5e8e301 100644
--- a/src/requirecontext.js
+++ b/src/requirecontext.js
@@ -293,12 +293,16 @@ var RequireContext = Fiber.extend(function () {
}
}
if (typeof factory === 'function') {
- factory.apply(module, resolved);
+ result = factory.apply(module, resolved);
@jakobo
jakobo / amd.js
Last active February 11, 2024 22:31
Shim your AMD
/*
================================================================================
ABOUT THIS FILE - amd shim https://gist.github.com/Jakobo/6894733
================================================================================
This file is a helper shim for pure AMD modules. When writing an AMD module,
you need to have access to a global "define" method. This creates a global
define(), a global require(), and a global AMD object.
define/require work like proper sinon stubs. Any define() calls that happen
before your test are automatically queued to run. You can then stub out
@jakobo
jakobo / rs.js
Last active December 20, 2015 17:58
UnLinked: Standalone
/**
* Redefines some functionality for the APIs, adding support for "clean" methods
*/
IN.Event.on(IN, "frameworkLoaded", function() {
var REGEX_TILDE = /^\~$/,
REGEX_BEGINS_WITH_URL = /^url=(.*)$/,
DEFAULT_KEY_MAPPING = [
{
find: REGEX_TILDE,
@jakobo
jakobo / javascript.md
Last active December 18, 2015 00:58
JavaScript.js: It's Just JavaScript!

JavaScript to JavaScript Compiler

Lightening Fast Compilation, Runs in Every Browser

There's a bunch of awesome technologies out there for converting to JavaScript. Ever since the days of Google Web Toolkit, it's been possible to write your JavaScript in one language, and have it interpreted into the most optimized output possible. Recently, there's been a glut of these cross compilers: Brython, Coffeescript, and Typescript all come to mind. The biggest limitation of these systems though is that you must either

  • pre-compile your code into JavaScript
  • or use a browser-side parser and interpreter

But no more! JavaScript.js runs natively in all browsers, doesn't require a build step, and hooks into every web browser's native JavaScript engine. To get started, you just need to have a script tag on your page.

#!/bin/sh
if [ -x "node -v" ]; then
echo " "
echo "Node installed correctly; continuing..."
else
echo " "
echo "Node not installed. Installing..."
curl https://raw.github.com/creationix/nvm/master/install.sh | sh
nvm install 0.8
8 -rw-r--r-- 1 jheuser 502 126 Jan 29 14:41 main.js
8 -rw-r--r-- 1 jheuser 502 212 Jan 29 14:41 testa.js
8 lrwxr-xr-x 1 jheuser 502 8 Jan 29 14:37 testb.js -> testa.js
@jakobo
jakobo / version.txt
Created December 5, 2012 00:50
dot notation
milestone.not-backwards-ok.backwards-ok
@jakobo
jakobo / signature.js
Created November 24, 2012 02:46
Define
define(factory);
define(id, factory);
define(dependencies, factory);
define(id, dependencies, factory);