Skip to content

Instantly share code, notes, and snippets.

@tylersticka
tylersticka / gulpfile.js
Last active August 29, 2015 13:57
Example of bespoke Gulp task that includes Knockout templates
/**
* This project's actual gulpfile contains much more than this,
* but these are the relevant bits.
*/
// Node libraries
var fs = require('fs');
var path = require('path');
// Gulp + plugins
@gordonbrander
gordonbrander / min-event-behavior.js
Last active August 21, 2018 11:57
Minimal FRP events and behaviors
// Minimal FRP Behaviors and Events.
// An event function is any function of shape `function (next) { ... }` where
// `next(value)` is a callback to be called by event function. Transformations
// of event are accomplished by wrapping event with another event function,
// and consuming original event within (CPS).
// A behavior is any function of shape `function (time) { ... }`, where
// `time` is current time. Behaviors may capture state, return value from time,
// or be constant. Behaviors must always return a value, but value may
@rrosiek
rrosiek / install_mysql.sh
Last active August 25, 2025 14:10
Vagrant provision script for php, Apache, MySQL, phpMyAdmin, Laravel, and javascript helpers. Tested with Ubuntu 16.04.
#! /usr/bin/env bash
###
#
# install_mysql.sh
#
# This script assumes your Vagrantfile has been configured to map the root of
# your application to /vagrant and that your web root is the "public" folder
# (Laravel standard). Standard and error output is sent to
# /vagrant/vm_build.log during provisioning.
@elclanrs
elclanrs / script.sh
Last active December 23, 2015 13:49
Git Deployment
mkdir /srv/git
adduser myuser www-data
git init --bare --shared=group /srv/git/app.git
mkdir /var/www/app
chown -R www-data:www-data /srv/git/app.git /var/www/app
chmod -R g+rw /srv/git/app.git /var/www/app
vim /srv/git/app.git/hooks/post-receive
#!/bin/sh
export GIT_WORK_TREE=/var/www/app
@dypsilon
dypsilon / frontendDevlopmentBookmarks.md
Last active September 25, 2025 20:45
A badass list of frontend development resources I collected over time.
@Dexyne
Dexyne / Haskell on Ubuntu 13.04.md
Last active December 1, 2023 09:39
Install Haskell (haskell-plateform-2013.2.0.0 + GHC 7.6.3) on Ubuntu 13.04.
@elclanrs
elclanrs / jquery.random-loop.js
Last active December 17, 2015 12:39
jQuery randomLoop
/**
* jQuery randomLoop
* @usage
* $('#container').randomLoop({
* selector: '.box',
* delay: 500,
* fade: true,
* speed: 'fast'
* });
*/
@wacko
wacko / gist:5577187
Last active July 13, 2024 00:48
SSH between Mac OS X host and Virtual Box guest

On Mac OS (host):

Shutdown your VM and do:

VirtualBox > Settings > Network > Add (you will get vboxnet0)

On a terminal ifconfig will show you new interface vboxnet0

VM's Settings > System > check "Enable I/O APIC." VM's Settings > Network > Adapter 2 > host-only vboxnet0

@elclanrs
elclanrs / jquery.keep-scrolling.js
Last active April 17, 2016 00:39
Simple Infinite Scroll
/**
* jQuery throttle / debounce - v1.1 - 3/7/2010
* http://benalman.com/projects/jquery-throttle-debounce-plugin/
*
* Copyright (c) 2010 "Cowboy" Ben Alman
* Dual licensed under the MIT and GPL licenses.
* http://benalman.com/about/license/
*/
(function(b,c){var $=b.jQuery||b.Cowboy||(b.Cowboy={}),a;$.throttle=a=function(e,f,j,i){var h,d=0;if(typeof f!=="boolean"){i=j;j=f;f=c}function g(){var o=this,m=+new Date()-d,n=arguments;function l(){d=+new Date();j.apply(o,n)}function k(){h=c}if(i&&!h){l()}h&&clearTimeout(h);if(i===c&&m>e){l()}else{if(f!==true){h=setTimeout(i?k:l,i===c?e-m:e)}}}if($.guid){g.guid=j.guid=j.guid||$.guid++}return g};$.debounce=function(d,e,f){return f===c?a(d,e,false):a(d,f,e!==false)}})(this);
@elclanrs
elclanrs / readme.md
Last active December 16, 2015 22:39
jquery.tinymodal