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
### | |
#Step 1 - Generate server certificates etc... (most of this code is horribly ripped off from nodejs docs currently -> http://nodejs.org/docs/latest/api/tls.html) | |
### | |
#Assuming your starting from a clean directory | |
mkdir server | |
cd server | |
#generate private key |
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
// http://www.epochconverter.com | |
function TimeCounter(t) { | |
var days = parseInt(t / 86400); | |
t = t - (days * 86400); | |
var hours = parseInt(t / 3600); | |
t = t - (hours * 3600); | |
var minutes = parseInt(t / 60); | |
t = t - (minutes * 60); |
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 <Bridge.h> | |
unsigned long timer; | |
unsigned long counter = 0L; | |
void setup() | |
{ | |
Serial.begin(9600); | |
Bridge.begin(); // this launches /usr/bin/run-bride on Linino | |
timer = millis(); |
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
from twitter import * | |
auth = OAuth( | |
consumer_key='2yiyIW2qqGfwblk1Tk8BqiygP', | |
consumer_secret='1FWJu5810Gng0QdZylIMZlA0v1aGsLv9muTh8xn5kouE4ZE6EV', | |
token='2886635781-2mXPbGqS6x3szeUjdjB50DGEcI9P2OOVWVCX13z', | |
token_secret='1SMDFRZdHqea5sKEzNQTVHdnUdFh7s5jDab2qNL1zTqKB' | |
) | |
t = Twitter(auth=auth) |
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
from PIL import Image | |
from math import pow | |
import colorsys | |
import urllib, cStringIO | |
T = 500 | |
URL = 'http://iot.merfobrienzi.it/img.jpg' | |
basewidth = 80 | |
# http://blog.soulwire.co.uk/code/actionscript-3/colourutils-bitmapdata-extract-colour-palette |
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
float val = (exp(sin(millis()/2000.0*PI)) - 0.36787944)*108.0; |
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
// to simulate some recordered arduino output that print a value each 100ms on a serial terminal | |
// thanks to https://github.com/mcollina and https://gist.github.com/walling/ | |
'use strict'; | |
var fs = require('fs'), | |
split2 = require('split2'), | |
through = require('through2') | |
var filename = process.argv[2]; |
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
<?php | |
/* | |
Plugin Name: qTranslate META | |
Plugin URI: http://johnjcamilleri.com/2010/01/qtranslate-and-multilingual-meta-tags/ | |
Description: Multilingual support for META tags. Requires qTranslate. | |
Version: 1.0.2 | |
Author: John J. Camilleri | |
Author URI: http://johnjcamilleri.com | |
*/ |
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 lang="en"> | |
<head> | |
<title>three.js webgl - interactive cubes</title> | |
<meta charset="utf-8"> | |
<meta name="viewport" content="width=device-width, user-scalable=no, minimum-scale=1.0, maximum-scale=1.0"> | |
<style> | |
body { | |
font-family: Monospace; |
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
/* | |
# random client_id and random client_secret | |
curl --form client_id='3MVG9Nc1qcT7BbZ1AmkC7gLt_RtFNrY9XCsATBeio3ijPozoP.4qTcKKDGOT5V2V78I.4Ne1RXRTEJjqoZzNC' \ | |
--form client_secret='6092197970455970980' \ | |
--form grant_type=password \ | |
--form username='[email protected]'\ | |
--form password='password' \ | |
https://site.com/services/oauth2/token | |