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
#!/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 \/\/ | |
\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\ | |
/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/ | |
--> |
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
function addTwitterBSRegs(id) { | |
var html = "<a class='reply' target='_blank' href='https://twitter.com/intent/tweet?in_reply_to="+id+"'>reply</a>"; | |
html += "<a class='retweet' target='_blank' href='https://twitter.com/intent/retweet?tweet_id="+id+"'>retweet</a>"; | |
html += "<a class='star' target='_blank' href='https://twitter.com/intent/favourite?tweet_id="+id+"'>star</a>"; | |
html += "<a class='twitter' target='_blank' href='https://twitter.com/'>twitter</a>"; | |
return html; | |
} |
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 reply = "https://twitter.com/intent/tweet?in_reply_to="+tweet.id; | |
var retweet = "https://twitter.com/intent/retweet?tweet_id="+tweet.id; | |
var star = "https://twitter.com/intent/favourite?tweet_id="+tweet.id; |
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 | |
$to = "+447515354472"; | |
?> | |
<Response> | |
<Sms to="<?php echo $to;?>" from="<?php echo $_POST['From'];?>"><?php echo $_POST['Body']; ?></Sms> | |
</Response> |
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
navigator.geolocation.getCurrentPosition(function(result) { | |
var location = data.coords; | |
// This now consists of: | |
// latitude | |
// longitude | |
// altitude (if avaiable) | |
// various other attributes | |