Skip to content

Instantly share code, notes, and snippets.

gulp = require 'gulp'
gutil = require 'gulp-util'
sass = require 'gulp-sass'
prefix = require 'gulp-autoprefixer'
coffee = require 'gulp-coffee'
coffeelint = require 'gulp-coffeelint'
concat = require 'gulp-concat'
plumber = require 'gulp-plumber'
changed = require 'gulp-changed'
uglify = require 'gulp-uglify'
@bstst
bstst / gulpfile.coffee
Last active August 29, 2015 14:08
working coffee gulp file, with browserify (watchify) and less builders / watchers
gulp = require 'gulp'
coffee = require 'gulp-coffee'
util = require 'gulp-util'
less = require 'gulp-less'
watch = require 'gulp-watch'
livereload = require 'gulp-livereload'
watchify = require 'watchify'
browserify = require 'browserify'
coffeeify = require 'coffeeify'
@straypacket
straypacket / index.html
Created June 26, 2013 23:58
Hierarchical edge bundling, adapted from Mike Bostock's work and Danny Holten's paper: http://www.win.tue.nl/~dholten/papers/bundles_infovis.pdf
<html>
<head>
<meta http-equiv="Content-Type" content="text/html;charset=utf-8"/>
<link type="text/css" rel="stylesheet" href="flare-style.css"/>
<style type="text/css">
path.arc {
cursor: move;
fill: #fff;
}
@cowboy
cowboy / jquery.ba-detach.js
Created May 18, 2011 12:54
jQuery Detach+: Improve .detach to allow optional reattaching!
/*!
* jQuery Detach+ - v0.1pre - 5/18/2011
* http://benalman.com/
*
* Copyright (c) 2011 "Cowboy" Ben Alman
* Dual licensed under the MIT and GPL licenses.
* http://benalman.com/about/license/
*/
(function($){
@orrybaram
orrybaram / listenWithMe.js
Last active July 31, 2016 20:54
Add an embedded spotify player that plays the track your currently listening to (or last listened to) Demo at http://orryb.com/projects/currentSpotify/
var ListenWithMe = (function() {
// Add your own config here
var LASTFM_API_KEY = "";
var LASTFM_USERNAME = "";
// Element to inject the widget into
var $playerWrapper = document.getElementById('spotify-player-wrapper');
return {
init: init
}
@lucasrizoli
lucasrizoli / gist:1603274
Created January 12, 2012 21:33
70 Unique Ways to Encode <
<
%3C
&lt
&lt;
&LT
&LT;
&#60
&#060
&#0060
&#00060
@sirkitree
sirkitree / node.js
Last active December 24, 2018 15:31
Parse a PHP file with Node.js and convert an array defined in the PHP script into a JSON object which the Node app can use.
var runner = require('child_process');
runner.exec(
'php -r \'include("settings.php"); print json_encode($databases);\'',
function (err, stdout, stderr) {
var connection = JSON.parse(stdout).default.default;
console.log(connection.database);
// result botdb
}
#!/usr/bin/env bash
DIR=$(dirname "$(readlink -f "$0")")
FILES="$DIR"/files/
mkdir -p "$FILES"/
if [ ! -f "$FILES"/sandbox-ca.crt ]; then
echo '########################################'
@pibby
pibby / critcss.snippet.js
Last active August 23, 2020 16:22 — forked from james-Ballyhoo/critcss.snippet.js
Critical CSS Finder w/media query support for those of us who write mobile-first CSS; will output to console; configurable viewport height on line 12.
/* Critical CSS Finder w/media query support and output to console
by Katie Harron - https://github.com/pibby - https://pibby.com
forked from james-Ballyhoo (https://gist.github.com/james-Ballyhoo/04761ed2a5778c505527) who forked from PaulKinlan (https://gist.github.com/PaulKinlan/6284142)
I don't know why this isn't keeping my 2 space indents :(
*/
(function() {
function findCriticalCSS(w, d) {
// Pseudo classes formatting
var formatPseudo = /([^\s,\:\(])\:\:?(?!not)[a-zA-Z\-]{1,}(?:\(.*?\))?/g;
@jlongster
jlongster / bloop.js
Last active September 5, 2022 23:33
bloop
(function() {
// Do not use this library. This is just a fun example to prove a
// point.
var Bloop = window.Bloop = {};
var mountId = 0;
function newMountId() {
return mountId++;
}