Skip to content

Instantly share code, notes, and snippets.

View yocontra's full-sized avatar

contra yocontra

View GitHub Profile
@yocontra
yocontra / gulpfile.js
Created February 17, 2014 19:51
folder concat
// pseudocode but something like this
var fs = require('fs');
var path = require('path');
var gulp = require('gulp');
var concat = require('gulp-concat');
var gif = require('gulp-if');
function getFolders(dir){
return fs.readdirSync(dir)
.filter(function(file){
@yocontra
yocontra / gulpfile.js
Created February 20, 2014 03:14
stream forking sample with gulp-if
var gulp = require('gulp');
var gi = require('gulp-if');
gulp.src(['*.js', '*.css'])
.pipe(dostuff())
.pipe(gi('*.js', gulp.dest('js'))
.pipe(gi('*.css', gulp.dest('css'))
.pipe(gulp.dest('all'));
var through = require('through2');
var gutil = require('gulp-util');
var exec = require('child_process').exec;
var escape = require('any-shell-escape');
module.exports = function (message, opt) {
if(!opt) opt = {};
if(!message) throw new Error('gulp-git: Commit message is required git.commit("commit message")');
if(!opt.args) opt.args = ' ';
@yocontra
yocontra / streams-macro.sjs
Created March 17, 2014 17:13
Overloads the | operator to let you put streams together. This is just a fun project, don't use this.
macro | {
rule infix {
$x:expr | $y ($args ...)
} => {
$x.pipe($y($args...))
}
rule infix {
$x:expr | $y
} => {
@yocontra
yocontra / helvetica-swag.styl
Created March 19, 2014 19:40
make every website look better
body
font-smoothing: antialiased
text-rendering: optimizeLegibility
font-family: "HelveticaNeue-Light", "Helvetica Neue Light", "Helvetica Neue", Helvetica, Arial, "Lucida Grande", sans-serif
font-weight: 300
'use strict';
var through = require('through2');
module.exports = function () {
return through.obj(function(file, enc, cb) {
cb(null, file.clone());
});
};
var util = require('loader-utils');
var File = require('vinyl');
var gulp2webpack = function(streamConstructor, opt) {
opt = opt || {};
return function(content) {
var cb = this.async();
if (opt.cacheable) this.cacheable();
var source = require('vinyl-source-stream')
var buffer = require('vinyl-buffer');
var queue = require('streamqueue');
gulp.task('shit', function(){
// make the fake file
var fakeFile = source('fake.js');
var buffered = fakeFile.pipe(buffer());
// join the streams
alias fucking=sudo
alias "npm-update"="rm -rf node_modules && npm install"
alias "update-everything"="nave usemain stable && sudo npm update -g && brew update && brew upgrade"
export PS1="\[\033[36m\]\u\[\033[m\]@\[\033[32m\]\[\033[33;1m\]\w\[\033[m\] (\$(git branch 2>/dev/null | grep '^*' | colrm 1 2)) \$ "
export CLICOLOR=1
export LSCOLORS=ExFxBxDxCxegedabagacad
alias ls='ls -GFh'
function parse_git_dirty {
.blur {
/* modern stuff */
-webkit-filter: blur(radius);
-moz-filter: blur(radius);
-o-filter: blur(radius);
-ms-filter: blur(radius);
filter: blur(radius);
/* gecko */
filter: url(blur.svg#blur);