Skip to content

Instantly share code, notes, and snippets.

View allspiritseve's full-sized avatar

Cory Kaufman-Schofield allspiritseve

  • Dexter, MI
View GitHub Profile
require 'phaxio'
Phaxio.api_key = 'xxx'
Phaxio.api_secret = 'xxx'
class Fax
def send_fax
file = File.open("/path/to/document.pdf")
to = 'tel:123-456-7890'
fax = Phaxio::Fax.create(to: to, file: file)
@allspiritseve
allspiritseve / node-resources.md
Last active January 4, 2017 17:33
Resources for learning Node.js
<!DOCTYPE html>
<html lang="en">
<head>
<script src="//cdn.rawgit.com/bigeasy/timezone/master/src/timezone.js"></script>
<script src="https://code.jquery.com/jquery-3.1.1.min.js"></script>
</head>
<body>
<h1>Time</h1>
#!/bin/bash
case "$1" in
production) environment=production; shift;;
staging) environment=staging; shift;;
* environment = staging;;
esac
case "$environment" in
staging) app=my-app-staging;;
(function(angular, factory) {
if (typeof define === 'function' && define.amd) {
define(['angular', 'ckeditor'], function(angular) {
return factory(angular);
});
} else {
return factory(angular);
}
}(angular || null, function(angular) {
var app = angular.module('ngCkeditor', []);
@allspiritseve
allspiritseve / gist:8115357
Last active January 1, 2016 07:59
Performance tips for Ruby on Rails

Re: This tweet

Partials as opposed to inlining?

Inlining, collection partials, helpers, or builder objects. Partials shouldn't be the only tool in your belt for reducing duplicated view code.

What's the alternative to AR instantiation? Better queries? find_each?

Depends on the situation.

@allspiritseve
allspiritseve / .vimrc
Last active December 15, 2015 09:29
Highlight invalid white space at the end of a line
autocmd InsertEnter * syn clear EOLWS | syn match EOLWS excludenl /\s\+\%#\@!$/
autocmd InsertLeave * syn clear EOLWS | syn match EOLWS excludenl /\s\+$/
highlight EOLWS ctermbg=red guibg=red
@allspiritseve
allspiritseve / post-receive
Last active December 15, 2015 05:19
Capistrano-like git deployment with symlinked release folders.
#!/bin/bash -l
export RACK_ENV="production"
export RAILS_ENV="production"
APP_PATH=/var/www/townstage
CURRENT="$APP_PATH/releases/$(date +"%Y%m%d%H%M")"
exit_with_error() {
echo "Error..."
@allspiritseve
allspiritseve / widget.js
Created March 5, 2013 17:04
Widget script for Townstage events
<script>
(function() {
var ts = document.createElement('script'),
s = document.getElementsByTagName('script')[0];
ts.type = 'text/javascript';
ts.async = true;
ts.src = 'http://townstage:3000/assets/widgets.js';
s.parentNode.insertBefore(ts, s);
})();
</script>