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 <Servo.h> // Standard servo library | |
Servo myservo; | |
#define SERVO_PIN 9 // Set to the controller pin for the servo | |
int servo_pos = 0; | |
int val1; // Floating value 1 | |
int val2; // Floating value 2 | |
int val3; // Floating value 3 |
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
<html> | |
<head> | |
<script type="text/javascript"> | |
/* | |
Sample code taken shamelessly (and modified) | |
from https://developers.google.com/google-apps/calendar/quickstart/js | |
*/ | |
// Your Client ID can be retrieved from your project in the Google | |
// Developer Console, https://console.developers.google.com |
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 e1start = e1.start.getTime(); | |
var e1end = e1.end.getTime(); | |
var e2start = e2.start.getTime(); | |
var e2end = e2.end.getTime(); | |
return (e1start > e2start && e1start < e2end || e2start > e1start && e2start < e1end); |
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 ( | |
"bytes" | |
"fmt" | |
"os/exec" | |
"strings" | |
) | |
func main() { |
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 struct, array, time, io, fcntl | |
I2C_SLAVE=0x0703 | |
# find with sudo i2cdetect -y 1 | |
HDC1008_ADDR = 0x40 | |
bus=1 | |
fr = io.open("/dev/i2c-"+str(bus), "rb", buffering=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
package logger | |
import ( | |
"encoding/json" | |
"fmt" | |
"io" | |
"log" | |
"os" | |
"runtime" | |
"time" |
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 ( | |
"bytes" | |
"code.google.com/p/portaudio-go/portaudio" | |
"encoding/binary" | |
"fmt" | |
"io" | |
"log" | |
"os" |
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
<html> | |
<head> | |
<meta charset="UTF-8"> | |
<title>Server-sent events demo</title> | |
</head> | |
<body> | |
<button>Close the connection</button> | |
<ul> | |
</ul> |
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
using System.Security.Cryptography; | |
/// Hashes an email with MD5. Suitable for use with Gravatar profile | |
/// image urls | |
public static string HashEmailForGravatar(string email) | |
{ | |
// Create a new instance of the MD5CryptoServiceProvider object. | |
MD5 md5Hasher = MD5.Create(); | |
// Convert the input string to a byte array and compute the hash. |
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 ( | |
"flag" | |
"fmt" | |
"os" | |
"time" | |
"github.com/stianeikeland/go-rpio" | |
) |
NewerOlder