Skip to content

Instantly share code, notes, and snippets.

Luke L Dachande663

View GitHub Profile
View keybase.md

Keybase proof

I hereby claim:

  • I am dachande663 on github.
  • I am dachande663 (https://keybase.io/dachande663) on keybase.
  • I have a public key whose fingerprint is 886E 6435 95E9 A2A3 9F9F 9F35 6FDD F978 53B0 2EBF

To claim this, I am signing this object:

@Dachande663
Dachande663 / perf.php
Created May 12, 2013
PHP function invokation comparison. 10 x 1,000,000 sample.
View perf.php
<?php
Array
(
[test()] => 100%
[B::test()] => 198.96%
[$c->test()] => 202.56%
[call_user_func_array] => 670.19%
[$e->__cal()] => 717.38%
[$f->__callStatic] => 734.18%
@Dachande663
Dachande663 / gist:3754533
Created Sep 20, 2012
PSR-0 Example Issue
View gist:3754533
<?php
use SomeGuys/Email;
namespace App/Controller;
class Contact extends /App/Controller {
public function action_index() {
@Dachande663
Dachande663 / gist:1433113
Created Dec 5, 2011
Accent Folding in Javascript
View gist:1433113
var accent_map = {
'':'a','Á':'a','á':'a','À':'a','à':'a','Ă':'a','ă':'a','':'a','':'a','':'a','':'a','':'a','':'a','':'a','':'a','Â':'a','â':'a','':'a','':'a','':'a','':'a','':'a','':'a','':'a','':'a','Ǎ':'a','ǎ':'a','Å':'a','å':'a','Ǻ':'a','ǻ':'a','Ä':'a','ä':'a','Ǟ':'a','ǟ':'a','Ã':'a','ã':'a','Ȧ':'a','ȧ':'a','Ǡ':'a','ǡ':'a','Ą':'a','ą':'a','Ā':'a','ā':'a','':'a','':'a','Ȁ':'a','ȁ':'a','Ȃ':'a','ȃ':'a','':'a','':'a','':'a','':'a','':'a','':'a','':'a','':'a','Ⱥ':'a','':'a','Ǽ':'a','ǽ':'a','Ǣ':'a','ǣ':'a',
'':'b','':'b','':'b','':'b','':'b','':'b','Ƀ':'b','ƀ':'b','':'b','Ɓ':'b','ɓ':'b','Ƃ':'b','ƃ':'b',
'Ć':'c','ć':'c','Ĉ':'c','ĉ':'c','Č':'c','č':'c','Ċ':'c','ċ':'c','Ç':'c','ç':'c','':'c','':'c','Ȼ':'c','ȼ':'c','Ƈ':'c','ƈ':'c','ɕ':'c',
'Ď':'d','ď':'d','':'d','':'d','':'d','':'d','':'d','':'d','':'d','':'d','':'d','':'d','Đ':'d','đ':'d','':'d','Ɖ':'d','ɖ':'d','Ɗ':'d','ɗ':'d','Ƌ':'d','ƌ':'d','ȡ':'d','ð':'d',
'É':'e','Ə':'e','Ǝ':'e','ǝ':'e','é':'e','È':'e','è':
@Dachande663
Dachande663 / get_todays_tweet_count.php
Created Apr 3, 2011
Return the current tweet count for todays date
View get_todays_tweet_count.php
<?php
function get_todays_tweet_count($user_id, $cache_for=900) {
if (false !== ($count = get_transient('hl_todays_tweet_count'))) {
return (int) $count;
}
$response = wp_remote_get('http://twitter.com/statuses/user_timeline/'.absint($user_id).'.json');
if(is_wp_error($response)) return false;
@Dachande663
Dachande663 / Plex Export Launchd Plist
Created Jan 28, 2011
Add to ~/Library/LaunchAgents
View Plex Export Launchd Plist
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Label</key>
<string>com.hybridlogic.plexscrobbler</string>
<key>ProgramArguments</key>
<array>
<string>/usr/bin/php</string>
<string>/Users/yourusername/path/to/plex/export/cli.php</string>
You can’t perform that action at this time.