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 | |
/** | |
* WordPress Query Comprehensive Reference | |
* Compiled by luetkemj - luetkemj.com | |
* | |
* CODEX: http://codex.wordpress.org/Class_Reference/WP_Query | |
* Source: http://core.trac.wordpress.org/browser/tags/3.3.1/wp-includes/query.php | |
*/ | |
$args = 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
RewriteEngine On | |
RewriteCond %{HTTPS} !=on | |
RewriteRule ^(.*)$ https://%{SERVER_NAME}/$1 [R,L] |
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 | |
// If your web server is accepting HTTPS connections directly, then the | |
// request will be directly on port 443. If we aren't on port 443, then | |
// it's possible we're using a proxy such as Varnish, in which case, most | |
// modern proxy servers send the HTTP_X_SSL_CIPHER header through with the | |
// request. You could also test for a custom header from your proxy too. | |
if (($_SERVER["SERVER_PORT"] != 443) && | |
(empty($_SERVER["HTTP_X_SSL_CIPHER"]))) | |
{ | |
Header("Location: https://".$_SERVER["SERVER_NAME"]. |
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 | |
// This creates a date string in the format YYYY-WNN, which is | |
// a four digit year followed by a hyphen and letter W then the | |
// two digit week number | |
$strtotime = date("o-\WW"); | |
// The $start timestamp contains the timestamp at 0:00 on the | |
// Monday at the beginning of the week | |
$start = strtotime($strtotime); |
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
Scotts-MacBook-Air:~ scott$ traceroute google.com | |
traceroute: Warning: google.com has multiple addresses; using 173.194.34.136 | |
traceroute to google.com (173.194.34.136), 64 hops max, 52 byte packets | |
1 192.168.0.1 (192.168.0.1) 6.925 ms 6.713 ms 7.589 ms | |
2 10.93.176.1 (10.93.176.1) 45.988 ms | |
bagu-core-2b-ae3-2365.network.virginmedia.net (80.5.167.229) 60.279 ms 33.725 ms | |
3 leed-bb-1b-ae7-0.network.virginmedia.net (80.5.161.245) 60.188 ms 31.955 ms 27.104 ms | |
4 leed-bb-1c-ae1-0.network.virginmedia.net (62.253.174.26) 81.292 ms 156.878 ms 134.829 ms | |
5 teln-ic-2-ae1-0.network.virginmedia.net (212.250.14.146) 176.878 ms 266.475 ms 381.205 ms | |
6 72.14.195.206 (72.14.195.206) 446.911 ms |
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
Using Google Chrome. | |
Go to a website. | |
Right click on the page somewhere. | |
Click inspect element | |
Click the console tab |
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 | |
# herein we backup our indexes! this script should run at like 6pm or something, after logstash | |
# rotates to a new ES index and theres no new data coming in to the old one. we grab metadatas, | |
# compress the data files, create a restore script, and push it all up to S3. | |
TODAY=`date +"%Y.%m.%d"` | |
INDEXNAME="logstash-$TODAY" # this had better match the index name in ES | |
INDEXDIR="/usr/local/elasticsearch/data/logstash/nodes/0/indices/" | |
BACKUPCMD="/usr/local/backupTools/s3cmd --config=/usr/local/backupTools/s3cfg put" | |
BACKUPDIR="/mnt/es-backups/" | |
YEARMONTH=`date +"%Y-%m"` |
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 | |
unload() { | |
kextstat | grep "org.virtualbox.kext.VBoxUSB" > /dev/null 2>&1 && sudo kextunload -b org.virtualbox.kext.VBoxUSB | |
kextstat | grep "org.virtualbox.kext.VBoxNetFlt" > /dev/null 2>&1 && sudo kextunload -b org.virtualbox.kext.VBoxNetFlt | |
kextstat | grep "org.virtualbox.kext.VBoxNetAdp" > /dev/null 2>&1 && sudo kextunload -b org.virtualbox.kext.VBoxNetAdp | |
kextstat | grep "org.virtualbox.kext.VBoxDrv" > /dev/null 2>&1 && sudo kextunload -b org.virtualbox.kext.VBoxDrv | |
} | |
load() { |
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 | |
header("Content-Type: text/plain"); | |
interface BillerInterface { | |
public function bill(array $user, $amount); | |
} | |
interface BillingNotifierInterface { | |
public function notify(array $user, $amount); | |
} |
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 | |
$code = \Input::get('go'); | |
$twitterService = OAuth::consumer('twitter'); | |
if (\Input::get('oauth_token')) { | |
$token = $twitterService->getStorage()->retrieveAccessToken('twitter'); | |
$twitterService->requestAccessToken( | |
\Input::get('oauth_token'), | |
\Input::get('oauth_verifier'), | |
$token->getRequestTokenSecret() |