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
// ---------------------------------------------------------- | |
// A short snippet for detecting versions of IE in JavaScript | |
// without resorting to user-agent sniffing | |
// ---------------------------------------------------------- | |
// If you're not in IE (or IE version is less than 5) then: | |
// ie === undefined | |
// If you're in IE (>=5) then you can determine which version: | |
// ie === 7; // IE7 | |
// Thus, to detect IE: | |
// if (ie) {} |
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 aes128_cbc_encrypt($key, $data, $iv) { | |
if(16 !== strlen($key)) $key = hash('MD5', $key, true); | |
if(16 !== strlen($iv)) $iv = hash('MD5', $iv, true); | |
$padding = 16 - (strlen($data) % 16); | |
$data .= str_repeat(chr($padding), $padding); | |
return mcrypt_encrypt(MCRYPT_RIJNDAEL_128, $key, $data, MCRYPT_MODE_CBC, $iv); | |
} |
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 | |
/* | |
Plugin Name: Custom-Post-Type Base | |
Plugin URI: http://pmg.co/ | |
Description: Dynamically change your custom post type slugs | |
Version: n/a | |
Author: Christopher Davis | |
Author URI: http://pmg.co/people/chris | |
License: GPL2/Creative Commons | |
*/ |
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
To remove a submodule you need to: | |
Delete the relevant line from the .gitmodules file. | |
Delete the relevant section from .git/config. | |
Run git rm --cached path_to_submodule (no trailing slash). | |
Commit and delete the now untracked submodule files. |
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
# nginx Embedded Perl module for adding a Content-MD5 HTTP header | |
# | |
# This perl module, will output an MD5 of a requested file using the | |
# Content-MD5 HTTP header, by pulling the hex hash from a file of the | |
# same name with .md5 appended to the end, if it exists. | |
# | |
# Author: Matt Martz <[email protected]> | |
# Link: https://gist.github.com/1870822#file_content_md5_req_dot_md5.pm | |
# License: http://www.nginx.org/LICENSE |
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
http://ictsentani.org/?p=258 | |
http://opensource.telkomspeedy.com/forum/viewtopic.php?pid=122506 | |
#------------------------------------------------------------------------------- | |
E1 Modem1 : 192.168.77.1 -> IP Modem1 : 192.168.77.2 | |
E2 Server : 192.168.88.1 -> IP Server : 192.168.88.2 | |
E3 Hotspot : 192.168.99.1 -> IP Hotspot : 192.168.99.10 - 192.168.99.250 | |
E4 Labkom : 10.10.10.254 -> IP Labkom : 10.10.10.1 - 10.10.10.20 | |
#------------------------------------------------------------------------------- |
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
// set-up a connection between the client and the server | |
var socket = io.connect(); | |
// let's assume that the client page, once rendered, knows what room it wants to join | |
var room = "abc123"; | |
socket.on('connect', function() { | |
// Connected, let's sign-up for to receive messages for this room | |
socket.emit('room', room); | |
}); |
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
# Unofficial brew formula for proxychains 4 | |
# Instruction: | |
# $ git clone git://gist.github.com/3792521.git gist-3792521 | |
# $ brew install --HEAD gist-3792521/proxychains4_formula.rb | |
# | |
# The default config file will be located in /usr/local/etc/proxychains.conf | |
# | |
require 'formula' | |
class Proxychains < Formula |
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 | |
/* | |
This code sample demonstrates several style for representing an option array with | |
the following fields: name, label, type_id, visible, default. | |
When designing this we should keep in mind that the option key may be represented | |
by either a literal or a (class)constant. As such we mix and match those for | |
illustrative purposes. | |
*/ |
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
import org.apache.xmlrpc.XmlRpcException; | |
import org.apache.xmlrpc.client.XmlRpcClient; | |
import org.apache.xmlrpc.client.XmlRpcClientConfigImpl; | |
@SuppressWarnings({ "unchecked", "rawtypes" }) | |
@Override | |
/** | |
* Create New Posts in Wordpress using Java | |
* | |
* //http://codex.wordpress.org/XML-RPC_WordPress_API/Posts#wp.newPost |
OlderNewer