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
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
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
#include <stdio.h> | |
#include <stdlib.h> | |
#define true 1 | |
#define false 0 | |
int main(void) { | |
int ptr = 4; | |
int feelings = (ptr + 1) ? true : false; |
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 *create() { | |
//this.body = yield render('submit', { referer: this.request.headers.referer, key: key || '' }); | |
var results = yield db.query("INSERT INTO `posts` (bla, bla) VALUES (bla, bla)"); | |
console.log(results); | |
this.response.end(); //redirect('/post/' + results[0][0].link); | |
} |
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
#!/bin/bash | |
# Log in to Carwings web interface | |
curl --data "j_username=$LEAF_USERNAME&j_passwordHolder=Password&j_password=$LEAF_PASSWORD" -c cookiejar.tmp https://www.nissanusa.com/owners/j_spring_security_check | |
# Request a status update | |
curl -b cookiejar.tmp https://www.nissanusa.com/owners/vehicles/statusRefresh?id=$LEAF_CARID | |
# Download status JSON (sync, blocking) | |
curl -b cookiejar.tmp https://www.nissanusa.com/owners/vehicles/pollStatusRefresh?id=$LEAF_CARID |
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
{ | |
"authLastModifiedDate": "2014-08-16T19:11:54Z", | |
"authToken": "[redacted]", | |
"chargeRequestDate": null, | |
"chargeTime": "15 hrs 30 min ", | |
"chargeTime220": "5 hrs 30 min ", | |
"chrgDrtn22066Tx": "4 hrs 0 min ", | |
"class": "com.nissanusa.owners.VehicleCarwings", | |
"currentBattery": 4, | |
"currentCharging": "NOT_CHARGING", |
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
" Assuming keyboard_leds is built and available in your PATH, | |
" this will make capslock indicate whether or not you are in insert mode. | |
autocmd InsertEnter * :!keyboard_leds -c1 | |
autocmd InsertLeave * :!keyboard_leds -c0 | |
" To make Vim control the keyboard backlight, use this. | |
" Note that it's glitchy and you'll probably toss the idea soon after. | |
" I can see programmatically controlling the lights to be useful in other cases, though. | |
" Install Lab tick and set a hotkey for Toggle, and one for Brighten. | |
" http://labtick.proculo.de/ |
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> | |
<script src='https://www.google.com/recaptcha/api.js'></script> | |
</head> | |
<body> | |
<h1>Register for test site</h1> | |
<form action="register" method="post"> | |
<input type="text" name="username" placeholder="Username"><br> |
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> | |
<script src='https://www.google.com/recaptcha/api.js'></script> | |
<script> | |
function registerAPI(form) { | |
var params = { | |
username: form.username.value, | |
password: form.password.value, | |
email: form.email.value, |