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 | |
# to check for zombie processes on Mac OS X | |
for pid in `ps -v -u james | awk '{print $1, $2}' | grep Z | awk '{print $1}'`; | |
do | |
ps -o command="" -p $pid >> ~/zombies.txt; | |
done | |
# Detect if file exists |
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 | |
include("/var/www/vhosts/xxxxxcom/httpdocs/PHPUtils/dbConfig.php"); | |
include("/var/www/vhosts/xxxxxcom/httpdocs/PHPUtils/DButils.php"); | |
// verifies receipt from iOS in-app purchase | |
// returns: | |
// 0 - if params missing | |
// 1 - if receipt is valid | |
// 2 - if invalid receipt, or invalid response from verification server | |
// or bundle/in-app IDs are incorrect |
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 | |
$dbConfig = array(); | |
$dbConfig['xxxxxx']['server'] = 'localhost'; | |
$dbConfig['xxxxxx']['user'] = 'username'; | |
$dbConfig['xxxxxx']['password'] = 'password'; | |
$dbConfig['xxxxxx']['database'] = 'database'; | |
?> |
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 | |
function connectToDBMYSQLI($dbConfig, $script, $die = true){ | |
$link = mysqli_connect($dbConfig['server'], $dbConfig['user'], $dbConfig['password'], $dbConfig['database'] ); | |
if (!$link) { | |
if($die == true){ | |
die("$script script Connect Error (" . mysqli_connect_errno() . ') ' . mysqli_connect_error()); |
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 | |
// URL is http://api.ipinfodb.com/v3/ip-city/?key=xxxxxxxxxx&ip=74.125.45.100 | |
/* response should be something like | |
{ | |
"statusCode" : "OK", | |
"statusMessage" : "", | |
"ipAddress" : "180.169.76.237", |
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
-- tip of the hat to Paul Calnan http://www.paulcalnan.com | |
-- for his Open Terminal Here extension that inspired this one | |
-- in fact half the code is nicked from him | |
set finderPath to "" | |
tell application "Finder" | |
try | |
set finderFolder to (folder of the front window as alias) | |
on error |
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
# -*- coding: utf-8 -*- | |
import alfred | |
import calendar | |
import time | |
import math | |
from delorean import utcnow, parse, epoch | |
# global var to see if user | |
# has a time offset |
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 | |
/* | |
* Admin User Interface | |
*/ | |
require_once plugin_dir_path( __FILE__ ) . 'yst_plugin_tools.php'; | |
require_once plugin_dir_path( __FILE__ ) . '/wp-gdata/wp-gdata.php'; | |
$options = get_option( 'Yoast_Google_Analytics' ); |
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 | |
# Error logging | |
e_error() { | |
printf "$(tput setaf 1)x %s$(tput sgr0)\n" "$@" | |
} | |
# only do this if you know how to set it back | |
# set date/time to 10:00 AM PDT | |
# export TZ=PST8PDT |
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 | |
// URL is http://api.ipinfodb.com/v3/ip-city/?key=526979f6d541396cee8be6452c39419e6d7eff9433febf55fe0bb1c27b14bb95&ip=74.125.45.100 | |
/* response should be something like | |
{ | |
"statusCode" : "OK", | |
"statusMessage" : "", | |
"ipAddress" : "180.169.76.237", |
OlderNewer