Instantly share code, notes, and snippets.

View keybase.md

Keybase proof

I hereby claim:

  • I am ryanseddon on github.
  • I am ryanseddon (https://keybase.io/ryanseddon) on keybase.
  • I have a public key ASALcuRRJgjeiZhwtUQauzfB3JG1vWS0cymBniHrjspJ7wo

To claim this, I am signing this object:

View dark.css
/* What? */
html, body, section {
height: 100%;
}
body {
background-color: black;
font-family: sans-serif;
color: #aaa;
View cli.bash
mocha --compilers js:babel/register,js:./test/css-modules-compiler.js --recursive -w
View _readme.md

Importing CSS packages via npm

If I have a package from npm let's say inuit-starter-kit which is a shell package that has its own dependencies. So all the packages I want to import exist in inuit-starter-kit/node_modules/{package}/{package}.scss.

Webpack

Webpack is configured to run all .scss files through sass-loader and then css-loader.

My entry file main.scss @imports all the deps using ~ to make sure it looks in node_modules

View keybase.md

Keybase proof

I hereby claim:

  • I am ryanseddon on github.
  • I am ryanseddon (https://keybase.io/ryanseddon) on keybase.
  • I have a public key whose fingerprint is 872E D0C3 2045 FF3A B02F 5630 92B5 512B 0ABC 22CF

To claim this, I am signing this object:

View idiot.js
var IE = 0,
OLD = 0;
function doListen() {
if(navigator.appName.indexOf("Explorer") > 0) IE = 1;
if(IE!=1 && parseInt(navigator.appVersion) == 4) {
document.captureEvents(Event.MOUSEDOWN);
document.onmousedown = mtMenu;
OLD=1;
View gulpfile.js
var gulp = require('gulp');
var es6ModuleTranspiler = require('gulp-es6-module-transpiler');
var browserify = require('gulp-browserify');
var through = require('through');
function transpileModuleSyntax(file) {
var data = '';
return through(write, end);
function write (buf) { data += buf }
View npm-debug.log
0 info it worked if it ends with ok
1 verbose cli [ 'node',
1 verbose cli '/usr/local/bin/npm',
1 verbose cli 'search',
1 verbose cli 'es6-module-transpiler' ]
2 info using npm@1.1.33
3 info using node@v0.8.1
4 verbose config file /Users/Ryan/.npmrc
5 verbose config file /usr/local/etc/npmrc
6 verbose config file /usr/local/lib/node_modules/npm/npmrc
View angular-controller-priority.js
var app = angular.module('app');
app.config(function($provide) {
$provide.decorator('ngControllerDirective', ['$delegate', function($delegate) {
$delegate[0].priority = 900;
return $delegate;
}]);
});
View curried.es5.js
function curried(fn) {
var args = Array.prototype.slice.call(arguments, 1);
return function() {
return fn.apply(this, args.concat(Array.prototype.slice.call(arguments, 0)));
}
}