Skip to content

Instantly share code, notes, and snippets.

Davey Shafik dshafik

Block or report user

Report or block dshafik

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View urban-crawl-api.json
{
"swagger": "2.0",
"info": {
"version": "2.0.0",
"title": "UrbanCrawl API"
},
"basePath": "/api/v2",
"paths": {
"/cities": {
"get": {
View image-gallery.js
View keybase.md

Keybase proof

I hereby claim:

  • I am dshafik on github.
  • I am davey (https://keybase.io/davey) on keybase.
  • I have a public key ASDw4CoRcb2uwfh0DlHrWlBXKlgzMmXy1kgsj8-XkIH04wo

To claim this, I am signing this object:

View README
Download Box Here: https://s3.amazonaws.com/dcousineau/vagrant/foundations.v0.box
Also On Vagrantcloud: https://vagrantcloud.com/dcousineau/lsp-foundations/version/1
View keybase.md

Keybase proof

I hereby claim:

  • I am dshafik on github.
  • I am davey (https://keybase.io/davey) on keybase.
  • I have a public key whose fingerprint is 971C 3240 6A3F 4EA6 777D CC77 0213 0706 2FE8 ED4C

To claim this, I am signing this object:

View typing-speed.php
<?php
// Just run the script and start typing asap. Hit enter to get a calculation.
$start = microtime(true);
$read = fgets(STDIN);
$end = microtime(true);
echo substr_count($read, " ") . " words in " . ($end - $start) . " seconds" . PHP_EOL;
@dshafik
dshafik / tokenize.php
Created Sep 27, 2013
A script to tokenize a given PHP script and display the list of tokens.
View tokenize.php
#!/usr/bin/env php
<?php
if (!isset($_SERVER['argv'][1])) {
echo "Usage: {$_SERVER['argv'][0]} <filename>" . PHP_EOL;
exit;
}
$tokens = token_get_all(file_get_contents($_SERVER['argv'][1]));
foreach ($tokens as $token) {
if (is_integer($token[0])) {
@dshafik
dshafik / Module.php
Created Jun 23, 2013
Add success message to ZfcUser without modifying the ZfcUser code in any way
View Module.php
<?php
namespace Application;
use Zend\Mvc\ModuleRouteListener;
use Zend\Mvc\MvcEvent;
class Module {
public function onBootstrap(MvcEvent $e)
{
$eventManager = $e->getApplication()->getEventManager();
View gist:4973517
diff --git a/runkit.c b/runkit.c
index 67c487b..4a15711 100644
--- a/runkit.c
+++ b/runkit.c
@@ -142,7 +142,7 @@ zend_module_entry runkit_module_entry = {
PHP_RSHUTDOWN(runkit),
PHP_MINFO(runkit),
#if ZEND_MODULE_API_NO >= 20010901
- PHP_RUNKIT_VERSION,
+ PHP_RUNKIT_VERSION,
View generator-testcase.php
<?php
date_default_timezone_set("America/New_York");
function gen() {
$i = 0;
while (true) {
file_put_contents("./log",
date("Y-m-d H:i:s") .' '.
(yield $i++) . ' ' .
PHP_EOL
, FILE_APPEND);
You can’t perform that action at this time.