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
{ | |
"currently": { | |
"apparentTemperature": 68.95, | |
"cloudCover": 0.18, | |
"dewPoint": 54.93, | |
"humidity": 0.61, | |
"icon": "clear-day", | |
"nearestStormBearing": 156, | |
"nearestStormDistance": 124, | |
"ozone": 338.39, |
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
{ | |
"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 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 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 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 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 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 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 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 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> |