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 twitterWidget extends WP_Widget { | |
public function config() { | |
return 'twitterWidget'; // Obj | |
} | |
function __construct() { | |
parent::__construct( | |
'twitter_widget', // Base ID |
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
var items = function(num) { | |
var arr = [1,3,3,5,2,7,4,10,6,4]; | |
/* | |
* Sort array low-high first | |
*/ | |
arr.sort(function(a,b) { | |
return a - b; | |
}); |
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 | |
USER=$1 | |
PASS=$2 | |
DB=$3 | |
HOST='' | |
DATE=`date +"%Y%m%d"` | |
cd ~/db-daily | |
mysqldump -u $USER -p$PASS -h $HOST $DB | gzip > $DB.sql.gz |
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
#!/usr/bin/env python | |
import sys | |
import getopt | |
import psutil | |
def main(argv): | |
# Define variables | |
cpuout = False |
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/bash | |
cd /tmp | |
## Get the executable | |
wget https://path/to/bin | |
## Make home for command | |
mkdir ~/bin | |
## Copy executable to command directory | |
cp /tmp/[bin] ~/bin/[command] |
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
/** | |
* Example init | |
* | |
* new Modal('login-form', { | |
* title = 'Please Log In', | |
* content = preloader.spawn(); | |
* }); | |
* | |
* @param name | |
* @param options |
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]*)(@import+)(.*;)(\r?\n|$)/g |
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 Deck { | |
protected $suits = array('Hearts', 'Spades', 'Clubs', 'Diamonds'); | |
protected $ranks = array('Ace', '2', '3', '4', '5', '6', '7', '8', '9', '10', 'Jack', 'Queen', 'King'); | |
public function cards() { | |
$cards = []; | |
foreach($this->suits as $suit) { | |
foreach($this->ranks as $rank) { | |
$cards[] = $rank . " of " . $suit; |
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 | |
$str = "About nine o'clock the moon was sufficiently bright for me to proceed on my way and I had no difficulty in following the trail at a fast walk, and in some places at a brisk trot until, about midnight, I reached the water hole where Powell had expected to camp. I came upon the spot unexpectedly, finding it entirely deserted, with no signs of having been recently occupied as a camp. | |
I was interested to note that the tracks of the pursuing horsemen, for such I was now convinced they must be, continued after Powell with only a brief stop at the hole for water; and always at the same rate of speed as his. | |
I was positive now that the trailers were Apaches and that they wished to capture Powell alive for the fiendish pleasure of the torture, so I urged my horse onward at a most dan1gerous pace, hoping against hope that I would catch up with the red rascals before they attacked him. | |
Further speculation was suddenly cut short by the faint report of two shots far ahead of me. I knew that Powell would need |
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 Stripe_Hook { | |
public function __construct() { | |
$this->listener(); | |
} | |
public function listener() { | |
if (isset($_GET['wps-listener']) && $_GET['wps-listener'] == 'stripe') { |
OlderNewer