Skip to content

Instantly share code, notes, and snippets.

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:

@ryanseddon
ryanseddon / dark.css
Created January 27, 2016 03:36
glittering.blue
/* What? */
html, body, section {
height: 100%;
}
body {
background-color: black;
font-family: sans-serif;
color: #aaa;
@ryanseddon
ryanseddon / cli.bash
Created October 9, 2015 05:44
Mocha compiler for css-module support in tests using sass
mocha --compilers js:babel/register,js:./test/css-modules-compiler.js --recursive -w
@ryanseddon
ryanseddon / _readme.md
Last active August 29, 2015 14:22
Webpack and css npm packages

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

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:

@ryanseddon
ryanseddon / idiot.js
Created August 18, 2014 10:36
Typical code written by a tab supporter
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;
@ryanseddon
ryanseddon / gulpfile.js
Created January 5, 2014 00:08
Gulp + browserify conundrum. How can I get browserify to properly transform the es6 module syntax to CommonJS syntax and pass along the stream so browserify can figure out how to bundle up the file into a single dist release? Is this possible?
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 }
@ryanseddon
ryanseddon / npm-debug.log
Created December 28, 2013 02:12
npm untrusted certificate issues
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
@ryanseddon
ryanseddon / angular-controller-priority.js
Created November 12, 2013 23:20
Angular 1.2.0 breaks when you try and do ng-controller + ng-include on the one element due to priority changes in the directives. Here's a workaround to monkey patch the priority until this ships in a release. See issue https://github.com/angular/angular.js/issues/4431
var app = angular.module('app');
app.config(function($provide) {
$provide.decorator('ngControllerDirective', ['$delegate', function($delegate) {
$delegate[0].priority = 900;
return $delegate;
}]);
});
@ryanseddon
ryanseddon / curried.es5.js
Created November 6, 2013 02:46
ES5 vs ES6 function currying
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)));
}
}