This file contains hidden or 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 success(position) { | |
// variable to store the coordinates | |
var location = position.coords.latitude + ',' + position.coords.longitude; | |
// setup the map using user location | |
var mapOptions = { | |
center: new google.maps.LatLng( position.coords.latitude, position.coords.longitude ), | |
zoom: 16, | |
zoomControl: true, |
This file contains hidden or 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
<script type="text/javascript" src="https://maps.googleapis.com/maps/api/js?key=API_KEY_GOES_HERE&sensor=true"></script> |
This file contains hidden or 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
sudo rsync -uvzr -e 'ssh -p 2222 -l username' domain.com:/var/www/html/ /var/www/html |
This file contains hidden or 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
sudo rsync -rv --exclude=".svn" /from/folder/ /to/folder/ |
This file contains hidden or 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
# Example using private key | |
Host ServerName1 | |
User root | |
HostName serverone.com | |
Port 2222 | |
IdentityFile ~/servername1.pem | |
# Example that requires password | |
Host ServerName2 | |
User ubuntu |
This file contains hidden or 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 query = new Parse.Query('User'); | |
query.find({ | |
success: function(results) { | |
// cycle through the results | |
for ( x in results ) { | |
// print out the usernames and email addresses | |
console.log( results[x].attributes.username + ' ' + results[x].attributes.email ); | |
} | |
}, | |
error: function(myObject, error) { |
This file contains hidden or 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 query = new Parse.Query('User'); | |
query.count({ | |
success: function(number) { | |
// print the count | |
console.log(number); | |
}, | |
error: function(error) { | |
// an error occured | |
console.log( error ); | |
} |
This file contains hidden or 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
// ACL to restrict write to user, and public read access | |
var custom_acl = new Parse.ACL(); | |
// give write access to the current user | |
custom_acl.setWriteAccess( Parse.User.current(), true); | |
// give public read access | |
custom_acl.setPublicReadAccess(true); | |
GameObject.setACL(custom_acl); | |
// ACL to restrict write to user, and no public access | |
var custom_acl = new Parse.ACL(); |
This file contains hidden or 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
$parse = new parseObject('BlogPost'); | |
$parse->title = "My first blog post"; | |
$parse->story = "Welcome to my site. This is my first..."; | |
$acl = new parseACL(); | |
// Give the user Write access to object | |
$acl->setWriteAccessForId( $user_id, true ); | |
// Give public read access | |
$acl->setPublicReadAccess( true ); | |
// Disable write access for public |
This file contains hidden or 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
# Go to wp-content folder | |
cd /path/to/wordpress/wp-content | |
# Find all files that have wpdb->escape | |
grep -ri 'wpdb->escape' * |