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 urllib2 | |
import json | |
def sendNotification(token, channel, message): | |
data = { | |
"body" : message, | |
"message_type" : "text/plain" | |
} | |
req = urllib2.Request('http://api.pushetta.com/api/pushes/{0}/'.format(channel)) |
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
from pushetta import Pushetta | |
API_KEY="00112233445566778899aabbccddeeff00112233" | |
p=Pushetta(API_KEY) | |
p.pushMessage("raspi", "Hello World"") |
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 <SPI.h> | |
#include <Ethernet.h> | |
///////////////// | |
// MODIFY HERE // | |
///////////////// | |
byte mac[] = { 0x00, 0xAA, 0xBB, 0xCC, 0xDE, 0x19 }; // Be sure this address is unique in your network | |
char APIKEY[] = "ffaabb444f1177772222f7243534badaanaa1100"; // Put here your API key | |
char CHANNEL[] = "my channel"; // and here your channel name | |
boolean DEBUG = true; |
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 | |
# -*- coding: utf-8 -*- | |
from smbus import SMBus | |
from pushetta import Pushetta | |
import math | |
import 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
import cv2 | |
def DetectFace(img, face_cascade, callback): | |
image = None | |
gray = cv2.cvtColor(img, cv2.COLOR_BGR2GRAY) | |
faces = face_cascade.detectMultiScale(gray, 1.3, 5) | |
for (x, y, w, h) in faces: |
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
postOnWall: function(message, name, description, link, picture, caption, onlyOne, cookieName) { | |
//vedo se ho il cookie settato | |
var alreadyPosted = ""; | |
alreadyPosted = leggiCookie(cookieName); // jshint ignore:line | |
if (alreadyPosted !== "true") { | |
FB.getLoginStatus(function(response) { | |
if (response.status === 'connected') { | |
var userId = response.authResponse.userID; | |
var access_token = response.authResponse.accessToken; | |
//vedo se ho il permesso di pubblicazione |
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
in_thread do | |
use_synth :fm | |
sleep 2 | |
loop do | |
28.times do | |
sample :drum_bass_hard, amp: 0.8 | |
sleep 0.25 | |
play :e2, release: 0.2 | |
sample :elec_cymbal, rate: 12, amp: 0.6 | |
sleep 0.25 |
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
public class NewClass { | |
private string _property { get; set; } | |
public NewClass(string s){ | |
this._property = s; | |
} | |
public static implicit operator NewClass(string s){ | |
return new NewClass(s); | |
} |
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 "mgos.h" | |
void int_func(int pin, void *arg) { | |
(void) arg; | |
LOG(LL_DEBUG, ("Pin pressed %d", pin)); | |
} | |
enum mgos_app_init_result mgos_app_init(void) { | |
mgos_gpio_init(); | |
mgos_gpio_set_mode(0, MGOS_GPIO_MODE_INPUT); |
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
void int_func() | |
{ | |
Serial.write("Button pressed"); | |
} | |
void setup() { | |
Serial.begin(115200); | |
pinMode(0, INPUT_PULLUP); | |
attachInterrupt(0, int_func, FALLING); |
OlderNewer