Skip to content

Instantly share code, notes, and snippets.

@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: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 / 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
<?php
class MyDevelopmentServiceManager
{
protected $factories = array(
'Foo' => '\MyModule\Foo',
'Bar' => '\MyModule\Bar',
);
protected $instances;
@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;
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'),
<?php
interface ClassGenerator
{
/**
* @return string
*/
public function getClassName();
/**
<?php
class Currency
{
/** @var string */
private $literalCode;
/** @var int */
private $numericCode;
<?php
/**
* Simple Loan Calculator
*
* This is standalone web application. It can calculate loan amortization
* schedule based on amount of requested loan, annual interest rate, loan
* fee and duration of the loan in months. Linear and annuity payment
* methods are supported.
*
{
"require": {
"twbs/bootstrap": "^3.3",
"jquery/jquery": "3.2.1"
},
"repositories": [
{
"type": "package",
"package": {
"name": "jquery/jquery",