Skip to content

Instantly share code, notes, and snippets.

@olsonpm
olsonpm / Sequence_equals.md
Last active August 29, 2015 14:13
Sequence.prototype.equals extension to Lazy.js

file -> lazy-extensions.js

'use strict';

var Lazy = require('lazy.js').strict();
var Sequence = Lazy.Sequence;
var xor = require('component-xor');

Sequence.prototype.equals = function equals(other_, eqFn_) {
    if (!(other_ instanceof Sequence)) {
@olsonpm
olsonpm / gist:df00ca2651c1dabd90a2
Last active August 29, 2015 14:14
Enabling iterators on ObjectLikeSequence.keys and *.values

##Code


//--------------------//
// ObjectLikeSequence //
//--------------------//

Lazy.ObjectLikeSequence.prototype.keys = function keys() {
    return new KeySequence(this);
};
@olsonpm
olsonpm / gist:e61f0233b518bacd9d37
Created January 31, 2015 12:27
sass fresh pull -> install -> test
> node-sass@2.0.0-beta pretest <path to my dir>/node-sass
> jshint bin lib test
> node-sass@2.0.0-beta test <path to my dir>/node-sass
> mocha test
@olsonpm
olsonpm / gist:749ed04e08e92af025ff
Created February 15, 2015 07:50
empty generator
module.exports = generators.Base.extend({
'constructor': function constructor() {
generators.Base.apply(this, arguments);
this.composeWith('personal-pjson', {
args: arguments[0]
});
this.composeWith('personal-fonts', {
args: arguments[0]
});
@olsonpm
olsonpm / gist:50c25bf2ebfa32777fe9
Created February 17, 2015 00:58
bundle install output
Fetching gem metadata from http://rubygems.org/........
Fetching version metadata from http://rubygems.org/..
Using rake 10.3.2
Gem::Ext::BuildError: ERROR: Failed to build gem native extension.
/usr/bin/ruby2.1 extconf.rb
mkmf.rb can't find header files for ruby at /usr/lib/ruby/include/ruby.h
extconf failed, exit code 1
@olsonpm
olsonpm / index.js
Created December 3, 2016 05:31
generator-option-type
'use strict';
var Base = require('yeoman-generator');
module.exports = Base.extend({
constructor() {
Base.apply(this, arguments);
this.option('aBoolOpt', {
type: Boolean
@olsonpm
olsonpm / at-rules.css
Last active March 21, 2018 17:50
the ASTs of well-supported at-rules
@charset "utf-8";
@namespace svg url(http://www.w3.org/2000/svg);
@import 'common.css' screen, projection;
@media (min-width: 500px) {
body {
background-color: blue;
}
@olsonpm
olsonpm / invertValueArrays.js
Created October 31, 2018 16:27
invertValueArrays
import * as _ from 'lodash';
//
// I couldn't figure out a clean way to write nor name this function. It's
// similar to lodash's "invertBy" except the values are arrays of strings.
//
// It's easiest examplained by example
//
// input
// {
//================= Hercules Configuration ================================
//= _ _ _
//= | | | | | |
//= | |_| | ___ _ __ ___ _ _| | ___ ___
//= | _ |/ _ \ '__/ __| | | | |/ _ \/ __|
//= | | | | __/ | | (__| |_| | | __/\__ \
//= \_| |_/\___|_| \___|\__,_|_|\___||___/
//================= License ===============================================
//= This file is part of Hercules.
//= http://herc.ws - http://github.com/HerculesWS/Hercules
{
"draft": 8,
"suzuki": {
"901": {
"full": "iVBORw0KGgoAAAANSUhEUgAABDgAAAQ4CAYAAADsEGyPAAeAc0lEQVR4nOzdaYyl133f+e8551nvUkt3NZtsLk1xc2KL9KJMbMlRZMmLZCMD25Mg42SCOAFmsvtV3iXwvAmCGXgyQYDMixlkkAR5EzibYUSOksCAFcVwRJtsUgtlkWz2yq7qrba7Pes5Jy/O8zx1iwmCxCIjlfT/AK2uLt66y1PVQp/f/S/Ke+8RQgghhBBCCCGEOMP0N/sJCCGEEEIIIYQQQnyjJOAQQgghhBBCCCHEmScBhxBCCCGEEEIIIc48CTiEEEIIIYQQQghx5knAIYQQQgghhBBCiDNPAg4hhBBCCCGEEEKceRJwCCGEEEIIIYQQ4syTgEMIIYQQQgghhBBnngQcQgghhBBCCCGEOPMk4BBCCCGEEEIIIcSZJwGHEEIIIYQQQgghzjwJOIQQQgghhBBCCHHmScAhhBBCCCGEEEKIM08CDiGEEEIIIYQQQpx5EnAIIYQQQgghhBDizJOAQwghhBBCCCGEEGeeBBxCCCGEEEIIIYQ48yTgEEIIIYQQQgghxJknAYcQQgghhBBCCCHOPAk4hBBCCCGEEEIIceZJwCGEEEIIIYQQQogzTwIOIYQQQgghhBBCnHkScAghhBBCCCGEEOLMk4BDCCGEEEIIIYQQZ54EHEIIIYQQQgghhDjzJOAQQgghhBBCCCHEmScBhxBCCCGEEEIIIc48CTiEEEIIIYQQQghx5knAIYQQQgghhBBCiDNPAg4hhBBCCCGEEEKceRJwCCGEEEIIIYQQ4syTgEMIIYQQQgghhBBnngQcQgghhBBCCCGEOPOib/YTEEIIIYQQ3368c/juYwV4wHsP3off30OpcEulFEprVPiEEEII8V9NAg4hhBBCCPFf9J8EEt7jvMc5i20t1lrquqZtG+q6pqlr2qalLFY4Z2nqGu8czjmcsxTFCm