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 | |
$files = array_slice($argv, 1); | |
foreach ($files as $file) { | |
$picture = file_get_contents($file); | |
$size = getimagesize($file); | |
// base64 encode the binary data, then break it into chunks according to RFC 2045 semantics | |
$base64 = chunk_split(base64_encode($picture)); |
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
body { | |
font-family: "Lucida Sans", "Lucida Grande", "Lucida Sans Unicode", sans-serif; | |
} | |
#text { | |
display: none; | |
} | |
.tag { | |
display: inline-block; |
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
$(document).ready(function() { | |
var text = $('#text').text(); | |
var word_array = text.split(' '); | |
// blank array to store result | |
var word_count = {}; | |
// lets count the words | |
for ( var x in word_array ) { |
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; | |
// select the span with id status | |
var s = $('#status'); | |
// update the status message | |
s.html('found you!'); |
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
$response = $this->facebook->api( '/' . $user_id . '/notifications', 'POST', array( | |
'template' => 'You have received a new message.', | |
'href' => 'path/to/message/?id=' . $id, | |
'access_token' => $app_access_token | |
) ); |
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']) { |
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
# Run everday at 2am | |
0 2 * * * /path/to/sql_backup.sh |