Skip to content

Instantly share code, notes, and snippets.

View 8bitDesigner's full-sized avatar

Paul Sweeney 8bitDesigner

  • Cisco Meraki
  • Los Angeles
View GitHub Profile
// Edge of the Empire RPG Dice Mechanics
//
// copyright pug games 2014
// please feel free to use this script, change it, add to it in any way you feel
// Script created by Roll20 user Konrad J.
// help with Dice specs by Roll20 users Alicia G. and Blake the Lake
// dice graphics hosted by Roll20 user Alicia G. at galacticcampaigns.com
// dice graphics borrowed from the awesome google+ hangouts EotE Dice App
// changed to randomInteger()
// added by Jarod: option to have the dice log on one line only (set eedGlobal.diceLogOnOneLine to false to restore old way)
@8bitDesigner
8bitDesigner / install.sh
Last active August 29, 2015 14:27
Instructions on what's needed on a new dev box
#### Things that need a GUI to install...
# "Command Line Tools (OS X 10.10) for Xcode 6.4"
# https://developer.apple.com/downloads/
#### Things that can be installed from the terminal
# Install Homebrew
ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
@8bitDesigner
8bitDesigner / favicon.js
Created March 5, 2015 20:19
Generating sized favicons from SVG
canvas32 = $('<canvas width=32 height=32>')
canvas16 = $('<canvas width=16 height=16>')
img = $('<img src="http://hampton.dev/assets/fs-logo-icon.svg">')
img.on('load', function() {
console.log('loaded')
ctx32 = canvas32[0].getContext('2d')
ctx32.drawImage(img[0], -4, 5, 39, 18)
$('body').append("<img src='"+canvas32[0].toDataURL("image/png")+"'>")
ctx16 = canvas16[0].getContext('2d')
@8bitDesigner
8bitDesigner / 1_before_gulpfile.js
Last active August 29, 2015 14:16
Moving from Gulp to Make. Can't say I miss Gulp at all.
var gulp = require('gulp')
, source = require('vinyl-source-stream')
, sass = require('gulp-sass')
, browserify = require('browserify')
, babelify = require('babelify')
gulp.task('build:js', function() {
return browserify('./app/public/jsx/app.jsx')
.transform(babelify)
.bundle()
@8bitDesigner
8bitDesigner / links.md
Created February 25, 2015 18:44
A list of handy books to get started with Front-End development
function Expression(expr, operator) {
this.precedence = operator ? operator.precedence : 9
this.expression = (expr instanceof Array) ? expr.join(" ") : expr
}
Expression.prototype.toString = function() {
return this.expression
}
var operators = {
var GIFEncoder = require('gifencoder')
, fs = require('fs')
, path = require('path')
, encoder = new GIFEncoder(864, 486)
, pngFileStream = require('png-file-stream')
, dir = process.argv[2]
pngFileStream(path.join(dir, '*.png'))
.pipe(encoder.createWriteStream({ repeat: 0, delay: 100, quality: 10 }))
.pipe(fs.createWriteStream('myanimated.gif'))
app.directive 'favorites', (overlay) ->
template: """
<button ng-click="show()">Show favorites</button>
"""
link: (scope) ->
scope.show = ->
overlay.open
templateUrl: 'favorites-list.html'
$scope: scope
postgres://user:pass@host:port/db
encoding
pool
app = angular.module('fs.collections')
app.factory 'BaseCollection', ($http, BaseModel) ->
class BaseCollection
model: BaseModel
currentlyFetching: false
constructor: (models, @opts) ->
@[key] = value for key, value of @opts
@models = []