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
<?php | |
/** | |
* Use namespace to avoid conflict | |
*/ | |
namespace PostType; | |
/** | |
* Class Event | |
* @package PostType | |
* |
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 | |
/** | |
* Generate a list of Status Cake Ip addresses | |
* To add allowed IPs to Nginx or Firewall | |
*/ | |
$statuscake_locations_json = "https://www.statuscake.com/API/Locations/json"; | |
$locations = json_decode(file_get_contents($statuscake_locations_json)); | |
$output = "#STATUS CAKE IPs" . "\n"; |
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