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 csv | |
import os | |
import random | |
from itertools import chain | |
from graphviz import Graph | |
def local_point_crawl(points, point_count, connections, connection_count): | |
dot = Graph(comment='Area Map') |
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
from flask import Flask | |
from flask import render_template | |
from random import randrange | |
#create the app object | |
app = Flask(__name__) | |
#get the database | |
import tables as t | |
..blah blah blah... |
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
from flask import render_template | |
from random import randrange | |
#create the app object | |
app = Flask(__name__) | |
#get the database | |
from tables import engine, temperature_table | |
@app.before_request | |
def before_request(): |
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
Getting docstrings right: | |
http://www.python.org/dev/peps/pep-0257/ | |
Getting syntastic to work on windows: | |
http://www.reddit.com/r/learnpython/comments/1bjq2g/if_you_use_vim_and_youre_using_python_or_learning/ |
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
from sqlalchemy import * | |
from datetime import datetime | |
metadata = MetaData('postgres://blah blah blah') | |
temperature_table = Table( | |
'tf_temperatures', metadata, | |
Column('id', Integer, primary_key=True), | |
Column('temperature', Float, nullable=False), | |
Column('datetime',DateTime, default=datetime.now)) |
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
#include <iostream> | |
#include <memory> | |
using namespace std; | |
class Foo { | |
public: | |
Foo(int a, int b) { | |
this->a = a; | |
this->b = b; |
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
#include <iostream> | |
#include <functional> | |
using namespace std; | |
using namespace std::placeholders; | |
int add(int a, int b) { | |
return a+b; | |
} |
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
cmake_minimum_required (VERSION 2.8) | |
add_definitions(-std=c++11) | |
project (ChaiTutorial) | |
add_library(myModule SHARED myModule.cpp) | |
list(APPEND LIBS ${READLINE_LIB}) | |
include_directories(/usr/local/include) | |
install(TARGETS myModule DESTINATION /usr/local/lib/chaiscript) |
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
#!/usr/bin/env python3 | |
from csv import reader | |
letter_template = """ | |
<html> | |
<body> | |
<p>{0} {1}</p> | |
<p>Hi,</p> |
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
#string interpolation is similar to python - be sure to import string utils | |
import strutils | |
var output = "a $1 parrot" % ["dead"] | |
echo(output) | |
for time in countUp(1,10): | |
echo("I like traffic lights $time" % ["time", intToStr(time)]) | |
echo("But only when they're green") |
NewerOlder