Skip to content

Instantly share code, notes, and snippets.

@Macrofig
Macrofig / _service.md
Created May 1, 2016 02:37 — forked from naholyr/_service.md
Sample /etc/init.d script

Sample service script for debianoids

Look at LSB init scripts for more information.

Usage

Copy to /etc/init.d:

# replace "$YOUR_SERVICE_NAME" with your service's name (whenever it's not enough obvious)
@Macrofig
Macrofig / pocketmine-raspbian-jessie.sh
Last active April 22, 2016 21:58
Installing PocketMine on Rasberry Pi running Raspbian Jessie
# Raspberry Pi Model B+ v1.2
# "Americanized" system
# Update keyboard layout
# Maxed out partition size
# Follow prompts
sudo raspi-config
sudo apt-get update
@Macrofig
Macrofig / parseString.js
Last active February 16, 2016 22:17
Parse string into array of maps using callback
/**
* @author Juan Orozco
*/
var can = require('can');
require('can/map/define/define');
// The default map for the character item
// The type can be anything, it should be used to mark what the item is
// The value is the character
@Macrofig
Macrofig / .dockerignore
Created December 27, 2015 05:42
Dockerfile for DoneJS
node_modules*
@Macrofig
Macrofig / gh-pages-deploy.md
Created December 27, 2015 02:59 — forked from cobyism/gh-pages-deploy.md
Deploy to `gh-pages` from a `dist` folder on the master branch. Useful for use with [yeoman](http://yeoman.io).

Deploying a subfolder to GitHub Pages

Sometimes you want to have a subdirectory on the master branch be the root directory of a repository’s gh-pages branch. This is useful for things like sites developed with Yeoman, or if you have a Jekyll site contained in the master branch alongside the rest of your code.

For the sake of this example, let’s pretend the subfolder containing your site is named dist.

Step 1

Remove the dist directory from the project’s .gitignore file (it’s ignored by default by Yeoman).

@Macrofig
Macrofig / UpgradeGhost.sh
Last active February 22, 2016 06:24
Script to backup and upgrade a Ghost install
# http://support.ghost.org/how-to-upgrade
# TODO
# ghost download root path
# ghost version
# webroot path
# download path
# backup path
# Make a backup
@Macrofig
Macrofig / CanJS_and_Firebase.js
Created October 4, 2014 04:13
Use Firebase REST API in CanJS.
//Still learning models... I'm wondering if this can be written better.
// This link explains how to cache the results to save on API calls...
// http://canjs.com/docs/can.Model.makeFindAll.html
var Posts = can.Model.extend({
findAll: 'GET https://myblog.firebaseio.com/website/posts.json',
makeFindAll: function( findAllData ){
var self = this;
return function(params, success, error){
return findAllData(params).then(function(data){
@Macrofig
Macrofig / FirebaseHaiku.js
Last active August 29, 2015 14:00
Using Firebase to store Haiku's then randomly rotating the library on a web page.
// Juan Orozco
// I love Firebase for its simplicity and power. It's great for applications that
// need web socket functionality or live loading. I like to use the developer buckets
// for prototpying, learning, and, in some cases, simple storage. This is an example
// of that use case.
// I have a page on my machine running as localhost that can post new Haiku. But anyone
// can read and display the list of Haiku I have stored there.
@Macrofig
Macrofig / gist:5022670
Last active December 14, 2015 03:39
Starts a Pomodoro "heat" using ThingM's Blink(1) as an indicator of the time. First 20 minutes are white. Followed by 4.5 minutes of orange. Then 20 seconds of red with the last of the time blinking red. The five minute break is 4 minutes of green; 50 seconds of orange, and 10 seconds of red blinks.
REM Clear the blinky
blink1-tool --off
REM Start 25 minutes
blink1-tool --rgb 255,255,255
blink1-tool --blink 3
blink1-tool --rgb 255,255,255
PING 1.1.1.1 -n 1 -w 1200000 >NUL
blink1-tool --rgb 255,174,0