Skip to content

Instantly share code, notes, and snippets.

View skinofstars's full-sized avatar

Kevin Carmody skinofstars

View GitHub Profile
@skinofstars
skinofstars / deploy.yml
Last active March 17, 2016 11:40
super basic deploy playbook
---
# ansible-playbook -i hosts -l production deploy.yml
- hosts: production
vars:
app_root: '/home/ubuntu/app'
app_public: "{{app_root}}/public_html"
tasks:
- synchronize: src=blog dest={{app_public}}/
- copy: src=foobar.txt dest={{app_root}}/
@skinofstars
skinofstars / .htaccess
Last active August 29, 2015 14:26
Some casual .htaccess gzip action
# normal rules before this
Options -Indexes
Header unset ETag
FileETag None
#Gzip
@skinofstars
skinofstars / packer.json
Created March 18, 2015 11:50
Ansible packer.json example
{
"variables": {
"aws_access_key": "",
"aws_secret_key": ""
},
"builders": [{
"type": "amazon-ebs",
"access_key": "{{user `aws_access_key`}}",
"secret_key": "{{user `aws_secret_key`}}",
"region": "eu-west-1",
### Keybase proof
I hereby claim:
* I am skinofstars on github.
* I am skinofstars (https://keybase.io/skinofstars) on keybase.
* I have a public key whose fingerprint is 969A 048C 6746 A52D 13C7 9267 AA1B 33F6 6ADB 691F
To claim this, I am signing this object:
@skinofstars
skinofstars / gitsubmodules.sh
Created January 26, 2015 18:21
pull git submodules
# every time, i forget how to pull submodules on a project where i forgot to do a --recursive clone/pull
git submodule init
git submodule update
@skinofstars
skinofstars / application_routes.js
Created December 11, 2014 15:39
Ember rollback unsaved changes on navigation
// Extend from this for a user to get a notification for unsaved model changes
// and rollback the model if they choose to navigate away.
Ember.DSModelRoute = Ember.Route.extend({
deactivate: function() {
var model = this.get('controller.model');
model.rollback();
if (model.get('isNew')) {
model.deleteRecord();
}
},
@skinofstars
skinofstars / rock_paper_scissors.js
Last active August 29, 2015 14:10
BrumJS - rock paper scissors
// BrumJS - Rock Paper Scissors bots game
// http://www.meetup.com/Brum-JS/events/218927668/
// https://github.com/mancjs/rock-paper-scissors
// water beats dynamite
// dynamite beats everything (max 5 use)
// for keeping track of some stuff
var game = {};
game.me = {};
@skinofstars
skinofstars / jobs_new_controller.js
Last active August 29, 2015 14:07
ember data not populating model errors
// using ActiveModelAdapter
App.ApplicationAdapter = DS.ActiveModelAdapter.extend();
// simple model
App.Job = DS.Model.extend({
external_ref: DS.attr("string")
});
// creating a new Job.
App.JobsNewController = Ember.Controller.extend({
#!/bin/sh
# working folder. world store, etc
cd /home/skinofstars/mc
rsync --rsh='ssh -p25561' -avz kevin@mc.skinofstars.com:mcsrv/* world_folder
cd world_folder
# so anyone can read the log
@skinofstars
skinofstars / lean.rb
Created July 16, 2014 20:11
lean kata.... err, less lean
# pommes, mele same as apples
@shop = {
apples: 100,
cherries: 75,
bananas: 150,
pommes: 100,
mele: 100
}