Skip to content

Instantly share code, notes, and snippets.

View mickstevens's full-sized avatar

Mick Stevens mickstevens

View GitHub Profile
@mickstevens
mickstevens / .bash_profile
Created September 18, 2018 16:58 — forked from natelandau/.bash_profile
Mac OSX Bash Profile
# ---------------------------------------------------------------------------
#
# Description: This file holds all my BASH configurations and aliases
#
# Sections:
# 1. Environment Configuration
# 2. Make Terminal Better (remapping defaults and adding functionality)
# 3. File and Folder Management
# 4. Searching
# 5. Process Management
@mickstevens
mickstevens / minesweeper.rb
Created February 26, 2017 19:29 — forked from JoshCheek/minesweeper.rb
Mine Sweeper
# vid @ https://twitter.com/josh_cheek/status/835884161047080960
# and @ https://vimeo.com/205773556
require 'graphics'
class MineSweeper
class Cell
attr_reader :x, :y
def initialize(mine:, clicked:, marked:, x:, y:)
@x, @y, @mine, @clicked, @marked = x, y, mine, clicked, marked
end
@mickstevens
mickstevens / keybase.md
Last active November 4, 2016 20:02
keybase.md

Keybase proof

I hereby claim:

  • I am mickstevens on github.
  • I am mickstevens (https://keybase.io/mickstevens) on keybase.
  • I have a public key whose fingerprint is BCB1 83E5 9D0C BF0E D36C 520C 8AFF 64E0 F774 3984

To claim this, I am signing this object:

# Sample code from TheSimplePostcard.com
# TechStack: Django, PostgreSQL, VQL, Twilio, Lob, Stripe, Bootstrap, usaddress
# Occasionally, we choose to ship a card for free
import datetime, random
def FreeCard():
die_1 = random.randint(1, 6)
die_2 = random.randint(1, 6)
current_month = datetime.datetime.now().month
return (die_1 + die_2) == current_month
@mickstevens
mickstevens / README.md
Created January 13, 2016 11:03 — forked from brampersandon/README.md
SOTU.rb: a quick method to tweet and text hot-takes simultaneously

SOTU.rb

My friend was stuck without an internet connection during this year's State of the Union. I wanted to make sure we could all share our hot takes and direct quotes with them, so I made this 'lil distribution channel in the ten minutes before the speech.

I wrote these docs, and this script, in a total of ten minutes. It may be a bit rough. I'll be making updates to simplify and clarify in a few minutes. If you have any questions, leave a comment on the Gist, or get at me on Twitter -- I'm glad to help!

APIs used

For SMS messaging, I used the awesome Twilio SMS APIs. To post to Twitter, I used the one, the only Twitter API.

To use

@mickstevens
mickstevens / gist:5f05b0ffa87d4e446a47
Created November 22, 2015 15:14 — forked from coolaj86/gist:2332953
Dimensions for VistaPrint business cards
Standard
Bleed Margin: 90mm x 52mm
Content Ends: 87mm x 49mm
Imperial
Bleed Margin: 3.54in x 2.05in
Content Ends: 3.43in x 1.93in
<?php
$db_host='dbserver';
$db_name='dbame';
$db_user='dbuser';
$db_passwd='dbpassword';
mysql_connect($db_host, $db_user, $db_passwd)
or die('Could not connect: ' . mysql_error());
mysql_select_db($db_name) or die('Could not select database');
@mickstevens
mickstevens / call.php
Last active August 29, 2015 14:21 — forked from jonmarkgo/call.php
<?php
require("Services/Twilio.php");
require("database.php");
// require POST request
if ($_SERVER['REQUEST_METHOD'] != "POST") die;
// generate "random" 6-digit verification code
$code = rand(100000, 999999);
{
"sparkAccessToken": "",
"sparkDeviceID": "",
"twilioAccountSID": "",
"twilioAuthToken": "",
"toPhoneNumber": "[NUMBER TO CALL]",
"fromPhoneNumber": "[YOUR TWILIO NUMBER]",
"paperTowelTwiml": "[URL TO TWIML FILE. DROPBOX WORKS GREAT]"
}
/* O U T O F O F F I C E F O R T W I T T E R */
/* - - - - - - - - - - - - - - - - - - - - - */
/* Written by Amit Agarwal http://labnol.org?p=27911 */
/* For customization and support, see http://ctrlq.org */
function start() {