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 | |
$folder = "Nerd Republic"; | |
$user = '{USERNAME}'; | |
$pass = '{PASSWORD}'; | |
$host = '{imap.gmail.com:993/imap/ssl}'.$folder; | |
$conn = imap_open($host,$user,$pass) or die(imap_last_error()); |
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 Slack = require('node-slack'), | |
webhookUri = '{WEBHOOKURI}'; | |
var slack = new Slack(webhookUri); | |
var users = [ | |
'sydlawrence', | |
'adverplanner', | |
'sophtly', | |
'robman', |
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
// taken from http://24ways.org/2012/cut-copy-paste/ | |
// requires the MD5 library available at http://pajhome.org.uk/crypt/md5 | |
function MD5Hex(str){ | |
result = MD5.hex(str).substring(0, 6); | |
return result; | |
} |
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
// taken from http://24ways.org/2012/cut-copy-paste/ | |
snappedXpos = floor( xPos / gridSize) * gridSize; |
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
// taken from http://24ways.org/2012/cut-copy-paste/ | |
deltaX = round(p2.x-p1.x); | |
deltaY = round(p2.y-p1.y); | |
diff = round(sqrt((deltaX*deltaX)+(deltaY*deltaY))); |
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
for(int i = 0; i<360; i++){ | |
float rad = DEG_TO_RAD * i; | |
int sinOut = constrain((sin(rad) * 128) + 128, 0, 255); | |
analogWrite(LED, sinOut); | |
delay(10); | |
} |
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
#!/bin/bash | |
#Force file syncronization and lock writes | |
mongo admin --eval "printjson(db.fsyncLock())" | |
MONGODUMP_PATH="/usr/bin/mongodump" | |
MONGO_HOST="127.0.0.1" #replace with your server ip | |
MONGO_PORT="27017" | |
MONGO_DATABASE="instawall" #replace with your database name |
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
#!/bin/bash | |
TIMESTAMP=`date +%F-%H%M` | |
S3_BUCKET_NAME="wmasbackups" #replace with your bucket name on Amazon S3 | |
S3_BUCKET_PATH="user-backups" | |
USER_NAME="syd" | |
echo "compressing user folder" | |
# Compressing | |
tar cf $USER_NAME-$HOSTNAME-$TIMESTAMP.tar /home/$USER_NAME/ |
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 | |
// include the twilio php help library | |
require "Services/Twilio.php"; | |
// Setup your credentials | |
$account_sid = "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"; | |
$auth_token = "YYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYY"; | |
// Step 3: instantiate a new Twilio Rest Client |
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
<!-- | |
/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/ | |
\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\ | |
/\/\ WMAS woz 'ere \/\/ Client Name Here \/\/ | |
\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\ | |
/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/ | |
--> |