Skip to content

Instantly share code, notes, and snippets.

View simplyluke's full-sized avatar

Luke Wright simplyluke

View GitHub Profile
@simplyluke
simplyluke / gist:239ab3989c5964039dfa
Created January 18, 2015 03:15
don't nobody got no mr roboto
/* ---------------------------------------------------------------------------
Interactive robot.
Command ref:
* click to get an "explosion" under your key and make his eyes flash red
* Down arrow makes his whole head red
* Left arrow makes him raise his right arm
* Press 'b' or "B" to make the background white instead of black
* Press '8' to make him look up
* Press 'j' to make him jump up
--------------------------------------------------------------------------- */
//for the nose
fill (#F1D5E5);
if ((keyPressed) && (key == CODED)){
if (keyCode == UP) {
fill (#F1D5E5);
ellipse (250,265, 9,8); //makes the nose bigger
}
} else {
ellipse (250,265, 5,4);
}
//for the nose
fill (#F1D5E5);
if ((keyPressed) && (key == CODED)){
if (keyCode == UP) { // add a bracket here
fill (#F1D5E5);
ellipse (250,265, 9,8); //makes the nose bigger
} if (keyCode == LEFT){ //indent this, it's still inside of the if ((keyPressed bit
fill (#45173A); //makes the nose disappear
ellipse (250,265, 9,8);
func fizzBuzz(n: Int) -> String {
if n % 3 == 0 && n % 5 == 0 {
return "FizzBuzz"
} else if n % 5 == 0 {
return "Buzz"
} else if n % 3 == 0 {
return "Fizz"
} else {
return String(n)
}
@simplyluke
simplyluke / gist:7557856
Created November 20, 2013 04:43
pgp public key - luke@simplyluke.com
-----BEGIN PGP PUBLIC KEY BLOCK-----
Version: SKS 1.1.0
mQINBFHcY3gBEAC6+EYoo80RApDi6RGtuyt9czBKcxms9WdlVrTOEULvZ9INY56ugCTC+R5T
l49pj97NE3R12QAZdchd7XsqFWeeTr3jUMQo2FMZ3LX+yzoqDCjKkIQwe9S9iqjwgn3KmQbV
9akB/W1lXuQXhAHQ6IDVKBjvKPZiDndNLpaJ4Eu45HZtTBitM9g7gTRAE+MetmQf5xD9a/ar
RUi8Gwm1OTT7HE85p6rxY4U5w8pk/9ffhCfoTvcOfHF/TZUf+8+W0L0p0dI5t1IlnpJ6Sc5I
xFeOkPZIHnl3k6EKMKO/2FH287OrUGgzIoczR/8Evy+u6jR6kTg3pgAd+Z+EZqIa8crE9EXl
ymJUhH3KjZUJJnhBAsB6LGxproELaVTFTYSHRUmbDM8qE31Be6FkMgRRAOcIQBTBZYXAN+c6
D29ACMGGi5ZY52x1Hef+jNGT8qTAEsN8QNjcUV7nkWrZ26KRKM76s3x4QzJRI+fdSTqt84AJ
@simplyluke
simplyluke / gist:7557842
Last active December 28, 2015 20:29
.vimrc
:set number
:syntax on
:colorscheme solarized
:set tabstop=2
:set shiftwidth=2
:set expandtab
@simplyluke
simplyluke / gist:8078644
Created December 22, 2013 04:59
Code club facebook solicitation
Austin High Students: I'm looking to start a code club in which we teach some programming skills and also collaborate in small groups on interesting projects.
I'm looking for 1 or 2 people to help me start this and a teacher to sponsor the club (they don't need to be overly involved in it, but AHS requires one). You don't need to be a programmer to help lead this, but you do need to have a desire to learn and help.
I'm working with a non-profit trying to enable starting these kinds of clubs with some very talented educators and coders in LA to help provide the materials.
If you know anyone who you think would be interested or teachers who may be able to sponsor it please let me know.
@simplyluke
simplyluke / gist:8191381
Last active January 1, 2016 19:38
RP Application API Design

Outline: RESTful API to manage the infrastructure of the application. Create users/goals/points via API and build mobile applications on top of it. I'm not too familiar with developing apps in this way, but it does not seem overly complicated. Pleae correct anything obviously wrong with this plan, still a noob

Users

Endpoints:

Users:

  • get /users, returns all users
  • get /users/:id, returns user
@simplyluke
simplyluke / homework.py
Last active January 3, 2016 01:59
the bridge problem
def higher(x):
a = (x-252.0)**2.0
b = a/(-824.0)
return b + 136 - 59
def lower(x):
a = (x-252.0)**2.0
b = a/(-538.1695)
return b + 118 - 59
@simplyluke
simplyluke / auth.py
Created April 2, 2017 23:32
flask auth
import os
from flask import Flask, request, session, url_for, redirect, \
render_template, abort, g, flash
from flask_bcrypt import Bcrypt
app = Flask(__name__)
bcrypt = Bcrypt(app)
app.config.from_object(os.environ['APP_SETTINGS'])