Skip to content

Instantly share code, notes, and snippets.

View dshafik's full-sized avatar
💫
Available for Hire!

Davey Shafik dshafik

💫
Available for Hire!
View GitHub Profile
mysql> CREATE TEMPORARY TABLE search_documents_test ( `id` int(10) );
Query OK, 0 rows affected (0.02 sec)
mysql> SHOW CREATE TABLE search_documents_test;
+-----------------------+---------------------------------------------------------------------------------------------------------------------+
| Table | Create Table |
+-----------------------+---------------------------------------------------------------------------------------------------------------------+
| search_documents_test | CREATE TEMPORARY TABLE `search_documents_test` (
`id` int(10) DEFAULT NULL
* GET /posts {"controller":"posts","action":"index"}
* GET /posts/{:id:\d+} {"controller":"posts","action":"show"}
* GET /posts/add {"controller":"posts","action":"add"}
* PUT /posts {"controller":"posts","action":"create"}
* GET /posts/{:id:\d+}/edit {"controller":"posts","action":"edit"}
* POST /posts/{:id:\d+} {"controller":"posts","action":"update"}
* DELETE /posts/{:id:\d+} {"controller":"posts","action":"delete"}
We couldn’t find that file to show.
<?php
for ($j = 1; $j < 10000000; $j = $j) {
$size = $j;
echo $size . " elements" . PHP_EOL;
$start = microtime(true);
for($i = 0; $i < $size; $i++) {
// do nothing
$array[$i] = new stdClass();
#!/bin/bash
if [ `./hptouchpad-status.sh` = 0 ];
then
growlnotify -I ./resources_touchpad_icon.icns -m "HP Touchpad in stock" -w
growlnotify -I ./resources_touchpad_icon.icns -m "HP Touchpad in stock" -w
growlnotify -I ./resources_touchpad_icon.icns -m "HP Touchpad in stock" -w
growlnotify -I ./resources_touchpad_icon.icns -m "HP Touchpad in stock" -w
growlnotify -I ./resources_touchpad_icon.icns -m "HP Touchpad in stock" -w
growlnotify -I ./resources_touchpad_icon.icns -m "HP Touchpad in stock" -w
growlnotify -I ./resources_touchpad_icon.icns -m "HP Touchpad in stock" -w
@dshafik
dshafik / ha_sphinx.h.patch
Created September 1, 2011 14:59 — forked from magicaltrevor/ha_sphinx.h.patch
patch for mysqlse/ha_sphinx.h put it in the same directory as source and run patch --dry-run -p0 -i ha_sphinx.h.patch then patch -p0 -i ha_sphinx.h.patch if no errors
*** mysqlse/ha_sphinx.h 2011-09-01 10:33:12.000000000 -0400
--- mysqlse/ha_sphinx.h 2011-09-01 10:33:01.000000000 -0400
***************
*** 1,5 ****
//
! // $Id: ha_sphinx.h 2428 2010-08-03 11:38:09Z shodan $
//
#ifdef USE_PRAGMA_INTERFACE
--- 1,5 ----
@dshafik
dshafik / ha_sphinx.cc.patch
Created September 1, 2011 15:00 — forked from magicaltrevor/ha_sphinx.cc.patch
patch for mysqlse/ha_sphinx.h put it in the same directory as source and run patch --dry-run -p0 -i ha_sphinx.h.patch then patch -p0 -i ha_sphinx.h.patch if no errors
*** mysqlse/ha_sphinx.cc 2011-09-01 10:33:06.000000000 -0400
--- mysqlse/ha_sphinx.cc 2011-09-01 10:32:49.000000000 -0400
***************
*** 1,5 ****
//
! // $Id: ha_sphinx.cc 2752 2011-03-29 08:21:05Z tomat $
//
//
--- 1,5 ----
@dshafik
dshafik / fuzzydate.php
Created September 20, 2011 15:04
Fuzzy Date Function
<?php
function fuzzyDate($date, $inputFormat = DateTime::ATOM, $outputDateFormat = "l, F dS, Y", $outputTimeFormat = "H:ia") {
if (!$inputFormat) {
$inputFormat = DateTime::ATOM;
}
if (!$outputDateFormat) {
$outputDateFormat = "l, F dS, Y";
}
<?php
for ($j = 1; $j < 10000000; $j = $j) {
$size = $j;
echo $size . " elements" . PHP_EOL;
$start = microtime(true);
for($i = 0; $i < $size; $i++) {
// do nothing
$array[$i] = new stdClass();
<?php
for ($j = 1; $j < 10000000; $j = $j) {
$size = $j;
echo $size . " elements" . PHP_EOL;
$start = microtime(true);
for($i = 0; $i < $size; $i++) {
// do nothing
$array[$i] = new stdClass();