├── app
│ ├── controllers
│ │ ├── admin
│ │ │ ├── posts.js
│ │ │ └── users.js
│ │ ├── posts.js
│ │ ├── session.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Show host IP address on your bash prompt. | |
# | |
# Example of prompt: | |
# | |
# moogs@192.168.1.100 : ~/Dropbox/workspace | |
# $ | |
# | |
export PS1="\n\n\[\033[0;36m\]\u@$(ifconfig | grep "inet " | grep -v 127.0.0. | awk '{print $2}')\[\033[00m\]\[\033[0;32m\] : \w\[\033[00m\]\n\[\033[00;32m\]\$\[\033[00m\] " | |
export PS2="\[\033[0;32m\]>\[\033[00m\] " |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
CACHE MANIFEST | |
# Revision 001 - 2013-12-01 | |
OFFLINE: | |
/ | |
# Cache resources as soon as they are downloaded. | |
CACHE: | |
/index.html | |
/favicon.ico |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Install latest Sass gem | |
sudo gem install compass --pre | |
# Install Compass sourcemaps gem | |
sudo gem install compass-sourcemaps --pre | |
# Run Compass as usual | |
compass watch |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module.exports = function (grunt) { | |
grunt.initConfig({ | |
pkg: grunt.file.readJSON('package.json'), | |
uglify: { | |
options: { | |
banner: '/*! <%= pkg.name %> <%= grunt.template.today("dd-mm-yyyy") %> */\n', | |
sourceMap: '/js/main.min.js.map', | |
sourceMapRoot: '/', | |
sourceMappingURL: '/js/main.min.js.map', | |
sourceMapPrefix: 1, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* Simple object serialization | |
* | |
* Example: | |
* var obj = {foo: 'bar', baz: 'quz'}; | |
* var querystring = serialize(obj); | |
* | |
* querystring value: | |
* foo=bar&baz=quz | |
*/ | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Returns an array of dates between the two dates | |
function getDates (startDate, endDate) { | |
const dates = [] | |
let currentDate = startDate | |
const addDays = function (days) { | |
const date = new Date(this.valueOf()) | |
date.setDate(date.getDate() + days) | |
return date | |
} | |
while (currentDate <= endDate) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Collision detection | |
// Returns true if one element overlaps the other | |
// Using jQuery | |
var collision = function($div1, $div2) { | |
var x1 = $div1.offset().left; | |
var y1 = $div1.offset().top; | |
var h1 = $div1.outerHeight(true); | |
var w1 = $div1.outerWidth(true); | |
var b1 = y1 + h1; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Convert a .MOV to an animated .GIF using FFMPEG and Gifsicle. | |
# Credit: https://gist.github.com/dergachev/4627207 | |
# | |
# Dependencies: | |
# ffmpeg | |
# gifsicle | |
# | |
# Example: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# vim /etc/network/interfaces | |
# | |
# it would be a good idea to update before: | |
# | |
# sudo apt-get update | |
# sudo apt-get upgrade | |
# sudo rpi-update | |
auto lo |