Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

<?php
class Currency
{
/** @var string */
private $literalCode;
/** @var int */
private $numericCode;
<?php
interface ClassGenerator
{
/**
* @return string
*/
public function getClassName();
/**
CREATE TABLE players (
player_id INT AUTO_INCREMENT NOT NULL,
player_name VARCHAR(255) NOT NULL,
PRIMARY KEY(player_id)
);
INSERT INTO players (player_name) VALUES
('Sasha'),
('Kris'),
@kastaneda
kastaneda / gist:ca958adb3d102c4f17a4
Created April 25, 2015 06:45
PSR-3 StdoutDebugLogger
<?php
use Psr\Log\LogLevel;
/**
* Dump just everything to da fokkin' stdout, yeah!
*/
class StdoutDebugLogger extends Psr\Log\AbstractLogger
{
protected $useAnsiCodes = false;
<?php
class MyDevelopmentServiceManager
{
protected $factories = array(
'Foo' => '\MyModule\Foo',
'Bar' => '\MyModule\Bar',
);
protected $instances;
@kastaneda
kastaneda / Makefile
Last active December 15, 2015 10:48
Holy Grail
# sudo apt-get install pandoc
MARKDOWN = pandoc --from markdown --to html5 --css style.css --standalone
# sudo apt-get install node-less
LESS = lessc --compress
SOURCE_PAGES = $(shell find . -type f -name '*.md')
TARGET_PAGES = $(patsubst %.md,%.html,$(SOURCE_PAGES))
all: $(TARGET_PAGES) style.css
@kastaneda
kastaneda / gist:4622394
Created January 24, 2013 14:37
I do not understand how I lived without it
Index: .fluxbox/init
===================================================================
--- .fluxbox/init (revision 762)
+++ .fluxbox/init (revision 763)
@@ -31,7 +31,7 @@
session.screen0.overlay.capStyle: CapNotLast
session.screen0.clientMenu.usePixmap: true
session.screen0.toolbar.visible: true
-session.screen0.toolbar.onhead: 0
+session.screen0.toolbar.onhead: 1
@kastaneda
kastaneda / composer.json
Created September 25, 2012 15:58
Yet another Silex + Twitter Bootstrap skeleton
{
"minimum-stability": "dev",
"require": {
"php": ">=5.3.3",
"silex/silex": "1.0.*",
"jquery/jquery": "@stable",
"twitter/bootstrap": "@stable"
},
"repositories": [
{
@kastaneda
kastaneda / gist:3528766
Created August 30, 2012 13:41
my fluxbox and multimedia keys
% grep Audio ~/.fluxbox/keys
XF86AudioPlay :ExecCommand mpc toggle
XF86AudioPrev :ExecCommand mpc prev
XF86AudioNext :ExecCommand mpc next
XF86AudioStop :ExecCommand mpc stop
XF86AudioLowerVolume :ExecCommand aumix -v-10
XF86AudioRaiseVolume :ExecCommand aumix -v+10
XF86AudioMute :ExecCommand aumix -v 0
@kastaneda
kastaneda / gist:2411383
Created April 18, 2012 06:01
JS and semicolon - my opinion
// This code is OK
if (navigator.geolocation) {
deploySelfDrivingCar()
notifyFlyingMonkeys()
} else {
asknicelyforlocation()
}
// Not OK
foo(); bar();