Skip to content

Instantly share code, notes, and snippets.

View AlexFrazer's full-sized avatar
🦊
🦊🦊🦊

Frazer AlexFrazer

🦊
🦊🦊🦊
View GitHub Profile
package Grid;
/**
* An imagereader that doesn't look at all like the professors + an edge detector. >.>
* (in my defense, it's mostly reading the API).
* I will use the Sobel's Operator, because I think it's the prettiest and I'm an annoying, pretentious, artist.
* Sobel's operator works by using a 3x3 matrix kinda operation to find the abruptness of change in rgb values.
* Therefore, my strategy will be to use a for loop to iterate through all the pixels and use this operator on all of them.
* Hopefully it works out.
*/
public class MainWindow {
public static void main(String[] args) {
// Write code that creates a window with a button
}
}
import sys
from collections import deque
queue=deque([])
k=int(sys.argv[1])
for line in sys.stdin:
queue.append(line)
#behold my python black magic
for x in reversed(queue):
if x==k: print queue[x]
from flask import request
from flask import json
from flask import Flask
from flask import render_template
import csv
import collections
import json
app = Flask(__name__, static_folder='assets',
static_url_path='/assets')
//this will not work:
thingsToLoad: [{
id: 'thing1',
controller: my_project_controller1
}, {
id: 'thing2',
controller: my_project_controller2
}],
init: function() {
$.getJSON('/get_some_json', function(json_data) {
$('#my_rendering_div') {
// render my content
}
});
{% extends "index.html" %}
{% block charts %}
{% for c in charts %}
<div id="{{ c['id']}}"></div>
{% endfor %}
<script type="text/javascript">
var charts = {{ charts }}
</script>
<script src="{{ url_for('static', filename='render_charts.js') }}"></script>
{% endblock %}
# imports are here
app = Flask(__name__)
app.secret_key = os.urandom(24)
@app.route('/')
def redirect_current_date():
redirect(url_for('charts', date=datetime.now().strftime('%Y%m')))
@app.route('/chart_group1')
from app.extensions import db
class Article(db.Model):
""" database representation of an article """
id = db.Column(db.Integer, primary_key=True)
title = db.Column(db.String(128))
subtitle = db.Column(db.String(512))
body = db.Column(db.Text())
votes = db.Column(db.Integer, default=1)
views = db.Column(db.Integer, default=1)
@AlexFrazer
AlexFrazer / 0_reuse_code.js
Last active August 29, 2015 14:06
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console