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
<!-- Include the twitter JS library --> | |
<script type="text/javascript" src="//platform.twitter.com/widgets.js"></script> | |
<!-- Tweet button with just text --> | |
<p><a href="https://twitter.com/intent/tweet?text=My first tweet using Web Intents">Tweet</a></p> | |
<!-- Tweet button with link and text --> | |
<p><a href="https://twitter.com/intent/tweet?url=http://www.webniraj.com/2013/08/08/twitter-api-tracking-tweets-using-web-intents/&text=Tracking tweets using Web Intents:"><img src="https://dev.twitter.com/sites/default/files/images_documentation/bird_blue_48.png" /></a></p> | |
<script type="text/javascript"> |
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
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
public function save_share() { | |
$response = array( 'response' => 'true' ); | |
$this->load->model( 'Share_model' ); | |
$meta = $this->input->post('meta'); | |
$insert = array( | |
'share_type' => $type, | |
'share_meta' => $meta['post_id'], |
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
{ | |
"post_id": "60506094_10100168488435226" | |
} |
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
{ | |
"id": "60506094_10100168488435226", | |
"from": { | |
"name": "Niraj Shah", | |
"id": "60506094" | |
}, | |
"picture": "http://platform.ak.fbcdn.net/www/app_full_proxy.php?app=134775570045880&v=1&size=z&cksum=70bc38ba261c36e640b74510949a4e2a&src=https%3A%2F%2Fstackexchange.com%2Fusers%2Fflair%2F557969.png", | |
"link": "https://www.webniraj.com/2013/05/11/facebook-api-tracking-shares-using-the-javascript-sdk/", | |
"name": "Facebook API: Tracking Shares using the JavaScript SDK", | |
"caption": "Tracking Facebook Shares on your website or application is a useful way of seeing how popular your articles are with your readers. In order to tracking Shares, you must used the Facebook JavaScript SDK.", |
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
# Run everday at 2am | |
0 2 * * * /path/to/sql_backup.sh |
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
#!/bin/bash | |
# Shell script to backup MySql database | |
# CONFIG - Only edit the below lines to setup the script | |
# =============================== | |
MyUSER="root" # USERNAME | |
MyPASS="password" # PASSWORD | |
MyHOST="localhost" # Hostname |
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
<?php | |
protected function getCode() { | |
$server_info = array_merge($_GET, $_POST, $_COOKIE); | |
if (isset($server_info['code'])) { | |
if ($this->state !== null && | |
isset($server_info['state']) && | |
$this->state === $server_info['state']) { |