Skip to content

Instantly share code, notes, and snippets.

@beeblesox
beeblesox / simple-gulpfile.js
Created June 14, 2014 16:09
Minimal gulp file that will serve files from a public folder, open chrome for you, and live reload on changes
var gulp = require('gulp'),
livereload = require('gulp-livereload'),
open = require('open'),
express = require('express'),
port = 80;
gulp.task('server', function(next){
var server = express().use(express.static( __dirname + '/public' )).listen(port, next);
var portStr = port == 80 ? '' : ':' + port;
open("http://localhost" + portStr, "chrome");
@beeblesox
beeblesox / function-definition.design-pattern.js
Created March 16, 2014 19:17
Function definition patterns
/*** function statement vs variable ****/
function myFunc(){}
// vs
var myFunc = function(){};
/***** Argument signature *****/
<html>
<head>
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js"></script>
<script>
$(document).ready(function(){
// $('.nav').sticky({$navWrap: $('.main')});
// $('.sidebar1').sticky({$boundingBox: $('.main')});
//$('.sidebar2').sticky({$boundingBox: $('.main')});
@beeblesox
beeblesox / gist:6218135
Last active December 21, 2015 00:09
This is a way you could achieve multiple, variable inheritance. I'm interested in what kind of performance hit this might have.
<?php
class Base {
function bse(){ echo "base <br />"; }
}
/* You would have to make a dependency-based loader
* to keep track of class names. Here, I'm just hard
* coding to show that it could work...
*/