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 koa = require('koa'); | |
var route = require('koa-route'); | |
var serve = require('koa-static'); | |
var db = require('./db'); | |
var render = require('./render'); | |
var app = koa(); | |
app.use(serve('public/')); |
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
function home() { | |
db.query("SELECT * FROM `posts` ORDER BY `time` DESC LIMIT 10", function(err, rows){ | |
render('home', { posts: rows[0] }, function(err, result){ | |
response.end(result); | |
}); | |
}); | |
} | |
function post(id) { | |
db.query("SELECT * FROM `posts` WHERE `link` = " + db.escape(id)), function(err, rows){ |
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
package main | |
import "fmt" | |
import "time" | |
func main() { | |
timestart := time.Now() | |
for c := 0; c < 100000000; c++ { |
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
<!doctype html> | |
<html> | |
<head> | |
<title>Example Domain</title> | |
<meta charset="utf-8" /> | |
<meta http-equiv="Content-type" content="text/html; charset=utf-8" /> | |
<meta name="viewport" content="width=device-width, initial-scale=1" /> | |
<style type="text/css"> | |
body { |
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
<!DOCTYPE html> | |
<html itemscope itemtype="http://schema.org/Article"> | |
<head> | |
<meta charset='utf-8'> | |
<title>Awesome Post</title> | |
<meta property="og:title" itemprop="name" content="Awesome Post" /> | |
<meta property="og:image" itemprop="image" content="http://example.com/awesomeimage.jpg" /> | |
<meta property="og:description" itemprop="description" content="This post is awesome" /> | |
</head> |
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
// Testing Gists in Vim | |
// This is neat! | |
// Testing from work machine |
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
final int SCAN_QR = 4; | |
@Override | |
protected void onCreate(Bundle savedInstanceState) { | |
super.onCreate(savedInstanceState); | |
Intent intent = new Intent(this, CaptureActivity.class); | |
startActivityForResult(intent, SCAN_QR); | |
} | |
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 android.app.Activity; | |
import android.view.View; | |
import android.view.WindowManager; | |
import android.os.Bundle; | |
import android.content.Context; | |
import android.content.Intent; | |
import android.content.IntentFilter; | |
import android.content.BroadcastReceiver; | |
import android.content.res.Resources; | |
import android.util.Log; |
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
<html ng-app='glassApp'> | |
<head> | |
<script src='http://cdnjs.cloudflare.com/ajax/libs/angular.js/1.3.0-beta.3/angular.js'></script> | |
<script> | |
glassApp = angular.module('glassApp', []); | |
glassApp.controller('glassController', function($scope) { | |
function server() { | |
WS.log('Welcome to WearScript'); | |
WS.sound('SUCCESS') |
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
/* | |
* Medli.js | |
* Main entry point for the board system | |
*/ | |
var cachedDOM = []; | |
// Because I'm lazy. And it does caching, so that's good, right? | |
var _g = function(id) { return cachedDOM[id] || (cachedDOM[id] = document.getElementById(id)); } |