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 usernames = [], | |
results = {}, | |
page = require('webpage').create(), | |
system = require('system'); | |
function init(){ | |
if (system.args.length === 1) { | |
console.log('Pass one or more twitter usernames as arguments'); | |
} else { | |
system.args.forEach(function (arg, i) { |
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
<?php | |
$o = exec('./phantomjs get_twitter_followers.js weworkweplay'); | |
$j = json_decode($o, true); | |
$fp = fopen('twitter_followers.txt', 'w'); | |
fwrite($fp, $j["weworkweplay"]); | |
fclose($fp); | |
echo $o; | |
?> |
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
# /etc/network/interfaces | |
auto wlan0 | |
iface lo inet loopback | |
iface eth0 inet dhcp | |
allow-hotplug wlan0 | |
iface wlan0 inet static | |
address 192.168.1.155 |
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
# /etc/wpa_supplicant/wpa_supplicant.conf | |
ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=netdev | |
update_config=1 | |
network={ | |
ssid="NYO_WWWP" | |
psk="topsecret" | |
proto=RSN | |
key_mgmt=WPA-PSK |
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> | |
<title>Canvas Boilerplate</title> | |
<style type="text/css"> | |
*,html{ | |
margin: 0;padding: 0; | |
} | |
canvas { | |
width: 100%; |
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 fs = require('fs') | |
, gm = require('gm'); | |
var threshold = { | |
"night": | |
{ | |
"from": 0, | |
"to": 10000 | |
}, | |
"morning": |
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
ping -c4 192.168.1.1 > /dev/null | |
if [ $? != 0 ] | |
then | |
sudo /sbin/shutdown -r now | |
fi |
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
ping -c4 192.168.1.1 > /dev/null | |
if [ $? != 0 ] | |
then | |
echo "No network connection, restarting wlan0" | |
/sbin/ifdown 'wlan0' | |
sleep 5 | |
/sbin/ifup --force 'wlan0' | |
fi |
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
int8_t sendATcommand(char* ATcommand, char* expected_answer, unsigned int timeout){ | |
uint8_t x=0, answer=0; | |
char response[100]; | |
unsigned long previous; | |
memset(response, '\0', 100); // Clean response buffer | |
delay(100); // Delay to be sure no passed commands interfere | |
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
sendATcommand("AT+CGPSURL=\"supl.google.com:7276\"","OK",1000); // sets GPS server | |
sendATcommand("AT+CGPSSSL=0","OK",1000); // without certificate |
OlderNewer