This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"net/http" | |
"os" | |
"strconv" | |
"github.com/gin-gonic/gin" | |
"github.com/joho/godotenv" | |
_ "github.com/joho/godotenv/autoload" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# App error handling | |
@app.errorhandler(404) | |
def page_not_found(e): | |
return jsonify(error=404, text=str(e)), 404 | |
@app.errorhandler(500) | |
def internal_server_error(e): | |
return jsonify(error=500, text=str(e)), 500 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$('#mc-embedded-subscribe-form').submit(function(e) { | |
e.preventDefault(); | |
$('#loading_gif_mc').show(); | |
$('#mc_embed_signup').hide(); | |
$.ajax({ | |
type: $('#mc-embedded-subscribe-form').attr('method'), | |
url: $('#mc-embedded-subscribe-form').attr('action'), | |
data: $('#mc-embedded-subscribe-form').serialize(), | |
cache: false, | |
dataType: 'json', |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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']) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//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); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//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); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* --------------------------------------------------------------------------- | |
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 | |
--------------------------------------------------------------------------- */ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
void setup (){ | |
size (500, 500); | |
background (255); | |
} | |
void draw () { | |
stroke (#45173A); | |
fill (#45173A); | |
background (255); | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//for the ball of yarn | |
if (keyPressed){ | |
if (key == 'g') { //changes color to green | |
fill (#3CB2B4); | |
} | |
if (key == 'p') { //changes color to purple | |
fill (#4436A1);} | |
} else { | |
fill (#307691);} //teal color | |
NewerOlder