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
package ddns | |
import ( | |
"log" | |
"net" | |
"sync" | |
) | |
var ( | |
dnsLock = &sync.Mutex{} |
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/sh | |
wget http://dev.mysql.com/get/Downloads/MySQL-5.6/mysql-5.6.24-osx10.9-x86_64.tar.gz | |
tar xfvz mysql-5.6* | |
echo "stopping mamp" | |
sudo /Applications/MAMP/bin/stop.sh | |
sudo killall httpd mysqld | |
echo "creating backup" |
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 | |
class BlogController extends Controller | |
{ | |
/** | |
* Posts | |
* | |
* @return void | |
*/ | |
public function showPosts() |
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
// html | |
<div>This is my post</div> | |
<!-- Just put this div at the bottom of your template somewhere--> | |
<!-- Notice that its hidden by default, so if it doesnt get used, thats fine--> | |
<div class="modal hide"></div> | |
//JS | |
$.ajax({ | |
type: 'post', // or post? |
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
// | |
// This is the result of about an hour's delving into PHP's hairy-ass serialization internals. | |
// PHP provides a session_decode function, however, it's only useful for setting the contents of | |
// $_SESSION. Say, for instance, you want to decode the session strings that PHP stores in its | |
// session files -- session_decode gets you nowhere. | |
// | |
// There are a bunch of nasty little solutions on the manual page[1] that use pretty hairy regular | |
// expressions to get the job done, but I found a simple way to use PHP's unserialize and recurse | |
// through the string extracting all of the serialized bits along the way. | |
// |