Skip to content

Instantly share code, notes, and snippets.

View garyblankenship's full-sized avatar
🎩
I may be slow to respond.

Gary Blankenship garyblankenship

🎩
I may be slow to respond.
View GitHub Profile
@garyblankenship
garyblankenship / imdb.php
Created March 7, 2012 01:11 — forked from silalahi/imdb.php
IMDb Wrapper Class PHP
<?php
/**
* IMDB Wrapper API
* Wrapper class to retrieve data from IMDB
* http://jogisilalahi.com/blog/imdb-api-wrapper-class-php
* @author Jogi Silalahi <[email protected]>
*/
class IMDB
<?php
$header = null;
$subscribers = array();
$handle = fopen(dirname(__FILE__).'/members_PHP_Weekly_Feb_6_2013.csv', 'r');
// fgetcsv is a bit naff, luckily I was able to massage this CSV into an easily parsable format
while (($line = fgetcsv($handle, 1000, ",")) !== false) {
if ($header === null) {
$header = $line;
} else {
$call_limit = 350; // API calls (in an hour)
$time_limit = 60 * 60; // 1 hour (in seconds)
$transient_name = $host . "_rate_limit"; // Using their host name as the unique identifier
// Check to see if there are any transients that match the name, if not create a new one
if ( false === ( $calls = get_transient( $transient_name ) ) ) {
$calls[] = time();
set_transient( $transient, $calls, $time_limit ); // Use an array of time() stamps for rolling effect
} else {
// There is already a transient with this name
<?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(
<?php
/**
* Plugin Name: Future Core Login
* Plugin URI: http://unserkaiser.com
* Description: Replacing the current stylesheets loaded on wp-login.php until this ticket goes into core: <a href="http://core.trac.wordpress.org/ticket/12506">#12506</a>
* Version: 0.1
* Author: Franz Josef Kaiser
* Author URI: http://unserkaiser.com
* License: GPL2
*
<?php
/**
* SplClassLoader implementation that implements the technical interoperability
* standards for PHP 5.3 namespaces and class names.
*
* http://groups.google.com/group/php-standards/web/final-proposal
*
* // Example which loads classes for the Doctrine Common package in the
* // Doctrine\Common namespace.
sudo port install php55 +fastcgi fcgi apache-ant php55-cgi php55-mbstring php55-curl php55-mcrypt php55-imagick php55-xdebug php55-iconv php55-mongo php55-oauth php55-openssl php55-esmtp php55-pop3 php55-tidy php55-uploadprogress php55-pcntl php55-sockets php55-soap php55-ssh2 php55-big_int php55-gd php55-svm php55-html_parse php55-http php55-mysql php55-pdflib php55-pear php55-peb php55-posix php55-pspell php55-rar php55-redis php55-snmp php55-stomp php55-svn php55-wddx php55-xmlrpc php55-yaml php55-zip php55-dbase php55-excel php55-gdchart php55-imap php55-xsl php55-redis
sudo port install postgresql92 postgresql92-server postgresql92-doc postgresql_autodoc php55-postgresql phppgadmin postgresql-jdbc mysql5-server phpmyadmin maven3 maven-ant-tasks
sudo port install nginx +flv +geoip +gzip_static +mail +mp4 +ssl +status +substitution +upload +upload_progress +xslt +zip
You may need to update your php.ini for any changes that have been made in this version of php55. Compare /opt/local/etc/php55/php.ini wit
#!/bin/bash
# script location
available=/etc/nginx/sites-available
enabled=/etc/nginx/sites-enabled
sites=/media/psf/Home/Sites
www=/var/www
# load in str replace function
. /usr/bash-scripts/gsub_literal.sh
// modules
var redis = require('redis');
var Step = require('step');
// config file
var config = require('config');
// mysql client connect
var mysql = require('mysql');
var connection = mysql.createConnection({
@garyblankenship
garyblankenship / app.rb
Created October 25, 2013 09:42 — forked from cpatni/app.rb
require 'sinatra'
require 'redis'
require 'json'
require 'date'
class String
def &(str)
result = ''
result.force_encoding("BINARY")