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
# encoding: utf-8 | |
import pytz | |
import datetime | |
from django.utils import timezone | |
""" | |
campus is a django model | |
for these examples: | |
campus.tz = 'America/Denver' |
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
/* | |
Arduino colour mood setter | |
*/ | |
int const rled = 11; | |
int const gled = 10; | |
int const bled = 9; | |
int const rrgb = 7; | |
int const grgb = 5; | |
int const brgb = 6; |
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
/* | |
Arduino Polyphonic Piano | |
Faris Chebib, 2014 | |
*/ | |
int notes[] = {245, 262, 294, 330, 349}; | |
int timer = 100; // play for this duration | |
int sound_pin = 12; | |
int const potPin = A0; |
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
#!/bin/bash | |
# from fixubuntu.com, in case the site is taken down | |
GS="/usr/bin/gsettings" | |
CCUL="com.canonical.Unity.lenses" | |
# Figure out the version of Ubuntu that you're running | |
V=`/usr/bin/lsb_release -rs` | |
# The privacy problems started with 12.10, so earlier versions should do nothing | |
if awk "BEGIN {exit !($V < 12.10)}"; then |
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, render_template, request | |
import stripe | |
stripe_keys = { | |
'secret_key': os.environ['SECRET_KEY'], | |
'publishable_key': os.environ['PUBLISHABLE_KEY'] | |
} | |
stripe.api_key = stripe_keys['secret_key'] |
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 unittest | |
from selenium import webdriver | |
# from selenium.common.exceptions import NoSuchElementException | |
from selenium.webdriver.common.keys import Keys | |
import time | |
import os | |
import re | |
import uuid |
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
// fsModel.js | |
// a simple file i/o node.js model | |
var fs = require("fs"); | |
var path = require("path"); | |
var uuid = require("node-uuid"); | |
var moment = require("moment"); | |
var extend = require("node.extend"); | |
var dbPath = "db/db.json"; | |
var filePath = path.resolve(__dirname, dbPath); |
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 octopress: https://github.com/imathis/octopress/blob/master/.themes/classic/source/_includes/asides/github.html | |
{% if site.github_user %} | |
<section> | |
<h1>GitHub Repos</h1> | |
<ul id="gh_repos"> | |
<li class="loading">Status updating...</li> | |
</ul> | |
{% if site.github_show_profile_link %} | |
<a href="https://github.com/{{site.github_user}}">@{{site.github_user}}</a> on GitHub | |
{% endif %} |
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
module.exports = { // Created with "sails generate Experience" → so the routes and controllers are auto-generated | |
attributes : { | |
organization: "STRING", | |
dateStarted: "DATE", | |
dateEnded: "DATE", | |
title: "STRING", | |
description: "STRING", | |
schoolOrWork: "STRING" |
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
exports.list = function(req, cb) { | |
client.get(MODELSET_ID + ":blog:entries", function(err, blogLen) { | |
if (err) { console.log(err); } | |
var retList = []; | |
function done (retBlog) { | |
console.log("pushing id: " + retBlog.metadata._id); | |
retList.push(retBlog); | |
blogLen--; | |
if (blogLen <= 0) { cb(retList); } |