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
node_modules |
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
$("ul.tweet-actions").each(function(index){ | |
$(this).prepend('<li><a role="button" class="my-custom-link" class="js-tooltip" href="#"><b>My Option</b></a></li>'); | |
}); | |
$(".my-custom-link").click(function(evt){ | |
evt.preventDefault(); | |
var el = $(evt.target) || $(evt.srcElement); | |
var tweetText = el.closest(".content").find("p.tweet-text").first().text(); | |
alert("This is the text from the tweet that you can use for something:\n\n" + tweetText); | |
}); |
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/env python | |
# | |
# file: isgovtdown.py | |
# | |
# description: checks usa.gov for the "Government has shut down" message | |
# | |
# usage: ./isgovtdown.py [pi] | |
# Passing argument 'pi' causes status LEDs to be used | |
# | |
# or in a crontab: |
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 sys, urllib | |
from time import sleep | |
import spidev | |
def spi_send(bus, data): | |
xfer_list = [] | |
if type(data) == str: | |
for c in data: | |
xfer_list.append(ord(c)) | |
elif type(data) == list: |
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
'use strict' | |
// A very simple nodeJS script that demonstrates how you can access | |
// memory usage information similar to how free -m works on the | |
// Raspberry Pi. Goes with µCast #14. http://youtu.be/EqyVlTP4R5M | |
// Usage: node pi_mem.js | |
// Example Output | |
// |
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 RPi.GPIO as GPIO | |
import spidev | |
from time import sleep, localtime, strftime, time | |
import sys | |
import smbus | |
class PiHardware(object): | |
def __init__(self): |
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
'use strict' | |
// An example of accessing system information on the Raspberry Pi with NodeJS | |
var fs = require('fs'); | |
var PiStats = function(){ | |
var stats = {}; | |
var _currentCPUInfo = {total:0, active:0}; | |
var _previousCPUInfo = {total:0, active: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
#!/usr/bin/env node | |
var app = require('../app'); | |
var io = null; | |
app.set('port', process.env.PORT || 3000); | |
app.get('/new', function(req, res){ | |
io.emit('yoReceived', req.query.username); | |
res.json(req.query); | |
}); |
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
[ | |
{ | |
"jumper": 17, | |
"pin": 1, | |
"name": "GP182_PWM2", | |
"description": "GPIO capable of PWM output.", | |
"tags": ["gpio", "pwm"] | |
}, | |
{ | |
"jumper": 17, |
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
HCI sniffer - Bluetooth packet analyzer ver 2.4 | |
device: hci0 snap_len: 1028 filter: 0xffffffff | |
> HCI Event: Command Complete (0x0e) plen 4 | |
LE Set Advertise Enable (0x08|0x000a) ncmd 1 | |
status 0x0c | |
Error: Command Disallowed | |
> HCI Event: Command Complete (0x0e) plen 4 | |
LE Set Advertise Enable (0x08|0x000a) ncmd 1 | |
status 0x00 | |
> HCI Event: Command Complete (0x0e) plen 4 |
OlderNewer