Skip to content

Instantly share code, notes, and snippets.

View MaxPleaner's full-sized avatar

Max Pleaner MaxPleaner

View GitHub Profile
@MaxPleaner
MaxPleaner / Preferences.sublime-settings
Last active October 10, 2016 18:44
Sublime text user settings
{
"auto_complete": false,
"auto_indent": true,
"auto_match_enabled": false,
"caret_extra_bottom": 5,
"caret_extra_top": 0,
"caret_extra_width": 0,
"caret_style": "solid",
"color_scheme": "Packages/Colorsublime-Themes/SisterTardis.tmTheme",
"font_size": 9,
@MaxPleaner
MaxPleaner / Default\ (Linux).sublime-keymap
Last active October 10, 2016 18:39
sublime text keybindings for keyboards with missing or badly placed 'home', 'end', 'pageup', and 'pagedown' keys.
[
// show folder in sidebar
{ "keys": ["ctrl+alt+o"], "command": "prompt_add_folder" },
// add folder to project
{ "keys": ["ctrl+alt+o"], "command": "prompt_add_folder" },
// remove folder from project
{ "keys": ["ctrl+alt+r"], "command": "close_folder_list" },
@MaxPleaner
MaxPleaner / 16step.coffee
Created December 14, 2015 18:36 — forked from peterc/16step.coffee
Simple 16 step drum machine using CoffeeScript and Node
# Simple 16 step drum machine experiment with Node and CoffeeScript
# by Peter Cooper - @peterc
#
# Inspired by Giles Bowkett's screencast at
# http://gilesbowkett.blogspot.com/2012/02/making-music-with-javascript-is-easy.html
#
# Screencast demo of this code at http://www.youtube.com/watch?v=qWKkEaKL6DQ
#
# Required:
# node, npm and coffee-script installed
Makes CRUD routes for a resource.
Credit goes to http://code.tutsplus.com/tutorials/building-single-page-web-apps-with-sinatra-part-1--net-27911
for the CRUD code. I added the sublime snippet variables and edited / built on it.
The tab stops will set the variables.
1. is for plural lowercase
2. is for singular lowercase
3. is for singular Capitalized (i.e. ClassName)
@MaxPleaner
MaxPleaner / gist:2d586e398600fa624d51
Created November 8, 2015 22:23 — forked from trcarden/gist:3295935
Rails 3.2.7 SSL Localhost (no red warnings, no apache config)
# SSL self signed localhost for rails start to finish, no red warnings.
# 1) Create your private key (any password will do, we remove it below)
$ openssl genrsa -des3 -out server.orig.key 2048
# 2) Remove the password
$ openssl rsa -in server.orig.key -out server.key
@MaxPleaner
MaxPleaner / .bashrc
Created September 29, 2015 05:39
send_email function for bashrc
function send_email {
curl --url "smtps://smtp.gmail.com:465" --ssl-reqd \
--mail-from "[email protected]" --mail-rcpt "$1" \
--upload-file $2 --user "[email protected]:$GMAIL_PASSWORD" --insecure
}
# replace symbolic.contrast with your email
# and export GMAIL_PASSWORD
# command line options are <recipient> <mail file>
# i.e. send_email [email protected] mail.txt
@MaxPleaner
MaxPleaner / weight_formatter.rb
Last active August 29, 2015 14:28
Weight formatter
module WeightFormatter
class << self
def format_weight(items)
# formats weights, prints new weights, and prints max & min weights
formatted = to_k_format(items)
print_weights(formatted)
print_max_and_min(formatted)
end
def to_k_format(items)
# converts "l"-formatted items to "c"
@MaxPleaner
MaxPleaner / computer_specs.txt
Created July 4, 2015 07:37
current computer specs
Unfortunately, I broke the screen on my Chromebook by getting a twig stuck between the keyboard and the display and closing it when going to sleep in my tent in Eugene.
Here are the specs of my new computer, which I bought at the Goodwill computer store here for $169.99
Operating System
MS Windows 7 Home Premium 64-bit SP1
CPU
Intel Mobile Core 2 Duo T6500 @ 2.10GHz 60 °C
Penryn 45nm Technology
RAM
Notes from http://www.learnshell.org/
---------------------------------------------
Interpreter name -
ps | grep $$
(assumed to be "bash")
Interpreter path -
which bash
def make_change(initial_cents=0)
remaining_cents = initial_cents
currency = {
# values are in num cents
"penny" => 1,
"nickel" => 5,
"dime" => 10,
"quarter" => 25,
"1 dollar" => 100,
"5 dollar" => 500,