Skip to content

Instantly share code, notes, and snippets.

@chrislopresto
chrislopresto / KeyboardHero.java
Last active August 29, 2015 14:20
MIDI Moonlight
// Instruments
int piano = 1;
// Notes
// Add notes as needed from http://www.tonalsoft.com/pub/news/pitch-bend.aspx
int g2 = 43;
int bFlat2 = 46;
int c3 = 48;
int cSharp3 = 49;
@chrislopresto
chrislopresto / Brocfile.js
Created April 27, 2015 19:44
Pod Structure Filenames
// Allow pod templates that aren't named template.hbs
app._podTemplatePatterns = function() {
return this.registry.extensionsForType('template').map(function(extension) {
return new RegExp('\.(.+\.)?' + extension + '$');
});
};
@chrislopresto
chrislopresto / Brocfile.js
Created April 24, 2015 01:09
Half-baked Broccoli-based Scss Linting
var mergeTrees = require('broccoli-merge-trees');
var scssLint = require('broccoli-scss-lint');
var path = require('path');
var appTree = app.toTree();
if (app.env !== 'production') {
var stylesTree = funnel('app/styles', {
srcDir: '/',
destDir: '/app/styles'
@chrislopresto
chrislopresto / deploy-gh-pages.sh
Created April 22, 2015 01:50
Deploy Ember App to GitHub Pages
#!/usr/bin/env bash
git checkout master
git pull
rm -rf dist
ember build --environment production
git checkout gh-pages
git pull
{
"extensions":
[
".jshintrc"
]
}
@chrislopresto
chrislopresto / phantomjs_poodling.sh
Created March 15, 2015 07:11
PhantomJS Poodling
ember-social › phantomjs -v
1.9.8
ember-social › phantomjs -h
Usage:
phantomjs [switchs] [options] [script] [argument [argument [...]]]
Options:
--cookies-file=<val> Sets the file name to store the persistent cookies
--config=<val> Specifies JSON-formatted configuration file
@chrislopresto
chrislopresto / Preferences.sublime-settings
Created March 11, 2015 05:49
Sublime User Preferences
{
// Themes
// Oceanic Next
// https://github.com/voronianski/oceanic-next-theme
"color_scheme": "Packages/Oceanic Next Color Scheme/Oceanic Next.tmTheme",
"theme": "Spacegray.sublime-theme",
// Predawn
// https://github.com/jamiewilson/predawn
@chrislopresto
chrislopresto / cookbook_placeholder_readme_files.rb
Last active August 29, 2015 14:12
Cookbook Placeholder README Files
def rfp(directory)
"cookbooks/#{directory}/README.md"
end
def md(directory)
"# #{directory} Cookbook\n\nThis is a placeholder README for the #{directory} cookbook.\n\n## TODO\n\n- [ ] Replace me"
end
def wf(directory)
File.open(rfp(directory), 'w+') { |file| file.write(md(directory)) }
@chrislopresto
chrislopresto / hall_message
Last active January 3, 2016 21:49
A bash executable with command line options to post into hall rooms
#!/bin/bash
# A convenient way to post to Hall rooms from the command line... as Lionel Richie
#
# Usage
# ./hall_message
# ./hall_message -m "Hello..."
# ./hall_message -p https://pbs.twimg.com/profile_images/421128111086764032/zv1APHT5.jpeg -t justin -m "I'll be your platinum, I'll be your silver, I'll be your gold"
# Hall integration guide..... https://hall.com/docs/integrations/generic/?uuid=523d0fc3e1681a6757f70ea0