This file contains hidden or 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
var http = require('http'); | |
var url = require('url'); | |
var portNumber = Number(process.argv[2]); | |
function parseTime(time) { | |
return { | |
hour: time.getHours(), | |
minute: time.getMinutes(), | |
second: time.getSeconds() | |
} |
This file contains hidden or 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
class CustomerListFormHelper(FormHelper): | |
form_id = 'customer-search-form' | |
form_class = 'form-inline' | |
field_template = 'bootstrap3/layout/inline_field.html' | |
field_class = 'col-xs-3' | |
label_class = 'col-xs-3' | |
form_show_errors = True | |
help_text_inline = False | |
html5_required = True | |
layout = Layout( |
This file contains hidden or 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
from flask import Flask | |
from flask import render_template, redirect, url_for, request, flash | |
from flask_pymongo import PyMongo | |
from bson.objectid import ObjectId | |
import os | |
import requests | |
import json | |
import datetime | |
app = Flask(__name__) |
This file contains hidden or 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
{% extends "layout.html" %} | |
{% block title %} | |
Reddit Reader | Public Timeline | |
{% endblock %} | |
{% block body %} | |
<h2><i class="fa fa-reddit-square"></i> Recent Reddits | |
<a style="margin-left:5px;" href="#menu-toggle" class="btn btn-default" id="menu-toggle"><i class="fa fa-toggle-left"></i> Toggle Menu</a> |
This file contains hidden or 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
#! /usr/bin/python | |
import time | |
import requests | |
import xml.etree.ElementTree as ET | |
my_latitude = 39.0548746 | |
url = 'http://ctabustracker.com/bustime/map/getBusesForRoute.jsp?route=' | |
route = str(input('Please select a bus route to view: ')) |
This file contains hidden or 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 | |
import collections | |
import random | |
import time | |
DataPoint = collections.namedtuple('DataPoint', 'id, x, y, temp, quality') | |
def main(): | |
print('Creating dataset.') | |
data_list = [] |
This file contains hidden or 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
#! /usr/bin/python | |
import os | |
import re | |
import requests | |
from bs4 import BeautifulSoup | |
url = 'http://random-name-generator.info' | |
hdr = { |
This file contains hidden or 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
from django.contrib.auth.models import User | |
from django.core.cache import cache | |
from django.core.exceptions import ObjectDoesNotExist | |
from django.core.urlresolvers import reverse | |
from django.db import models | |
from django.db.models import Q | |
class Alert(models.Model): | |
SYSTEM_ALERT = 'system_alert' |
This file contains hidden or 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
#! flask/bin/python | |
from flask import Flask, request, jsonify, abort, make_response, url_for | |
from flask_restful import Api, Resource, reqparse, fields, marshal | |
from flask_httpauth import HTTPBasicAuth | |
from datetime import datetime | |
import pyodbc | |
import json | |
import config |
This file contains hidden or 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
class Item(TimeStampedModel): | |
LEADTIME_PERIOD = ( | |
('D', 'DAYS'), | |
('W', 'WEEKS'), | |
('M', 'MONTHS'), | |
) | |
sku = models.CharField(max_length=50, blank=False, null=False) | |
item_name = models.CharField(max_length=50, blank=False, null=False) | |
item_description = models.TextField() |