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
<uses-permission android:name="android.permission.ACCESS_WIFI_STATE"></uses-permission> | |
<uses-permission android:name="android.permission.INTERNET"></uses-permission> |
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 <math.h> | |
void setup() | |
{ | |
pinMode(11, OUTPUT); | |
} | |
void loop() | |
{ | |
float val = (exp(sin(millis()/2000.0*PI)) - 0.365)*100.0; |
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
// | |
// StickyHeaderLayout.h | |
// Wombat | |
// | |
// Created by Todd Laney on 1/9/13. | |
// Copyright (c) 2013 ToddLa. All rights reserved. | |
// | |
// Modified from http://blog.radi.ws/post/32905838158/sticky-headers-for-uicollectionview-using THANKS! | |
// |
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 random | |
import hashlib | |
import base64 | |
base64.b64encode(hashlib.sha256( str(random.getrandbits(256)) ).digest(), random.choice(['rA','aZ','gQ','hH','hG','aR','DD'])).rstrip('==') |
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> | |
<script src='//code.jquery.com/jquery-1.7.2.min.js'></script> | |
<script src="//localhost:3000/socket.io/socket.io.js" type="text/javascript"></script> | |
<script> | |
var socket = io.connect('//localhost:3000'); | |
socket.on('welcome', function(data) { | |
$('#messages').append('<li>' + data.message + '</li>'); |
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 http = require('http'), | |
fs = require('fs'), | |
// NEVER use a Sync function except at start-up! | |
index = fs.readFileSync(__dirname + '/index.html'); | |
// Send index.html to all requests | |
var app = http.createServer(function(req, res) { | |
res.writeHead(200, {'Content-Type': 'text/html'}); | |
res.end(index); | |
}); |
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/python | |
# -*- encoding: utf-8-*- | |
from bs4 import BeautifulSoup | |
import urllib2 | |
def main(): | |
data = urllib2.urlopen('https://play.google.com/store/apps/details?id=com.sparkslab.ourcitylovereporter') | |
html = data.read() |
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/pyhton | |
# -*- encoding: utf-8 -*- | |
import urllib2 | |
import json | |
import pygmaps | |
from pygeocoder import Geocoder, GeocoderError | |
url = 'http://data.taipei.gov.tw/opendata/apply/query/QzhBMEJFOTctMEEzRC00M0Q2LThDNDktNDVCNDc3NDNDRDBC?$format=json' |
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 math | |
########################################################### | |
## Google map python wrapper V0.1 | |
## | |
############################################################ | |
class maps: | |
def __init__(self, centerLat, centerLng, zoom ): | |
self.center = (float(centerLat),float(centerLng)) |
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/python | |
import urllib2 | |
import json | |
import pygmaps | |
url = 'http://60.199.253.136/api/action/datastore_search?resource_id=d7a1b4c2-cad0-44f2-958a-a9d7a9330c95&limit=10000' | |
def main(): | |
content = urllib2.urlopen(url).read() |