Skip to content

Instantly share code, notes, and snippets.

@gordalina
gordalina / Example.php
Created May 17, 2013 08:40
Resolve Link headers into entities and inject them in the request attributes
<?php
// Controller
public function linkAction(Request $request)
{
if (false === $request->attributes->has('link')) {
throw new HttpException(400, 'Link header was not provided');
}
@raykolbe
raykolbe / CQRS.php
Created May 21, 2013 20:36
CQRS is simple!
<?php
namespace CQRSSample\Domain\Model
{
/**
* Please read this. It may be interesting to you. You can ridicule me ONLY if you read the whole thing.
*
* CQRS is NOT about different data sources and is NOT about Event Sourcing.
* CQRS IS about breaking out your reads and writes. It's powerful and simple!
@mathiasverraes
mathiasverraes / TestFrameworkInATweet.php
Last active September 24, 2024 14:47
A unit testing framework in a tweet.
<?php
function it($m,$p){echo ($p?'✔︎':'✘')." It $m\n"; if(!$p){$GLOBALS['f']=1;}}function done(){if(@$GLOBALS['f'])die(1);}
function setSelectionPlugin() {
var _setSelectionRange, _getCursorPosition, support = (function() {
var input = document.createElement('input'), result;
result = {
setSelectionRange: ('setSelectionRange' in input) || ('selectionStart' in input),
createTextRange: ('createTextRange' in input) || ('selection' in document)
};
input = null;
return result;
}());
[alias]
b = branch
bl = branch-list
bn = rename-branch
br = branch -r
c = checkout
cm = commit -m
cp = cherry-pick
d = diff
df = commits-of-changed-files
@mmoreram
mmoreram / post.md
Last active August 29, 2015 14:08
Dependency Injection and TDD

La mayoría de los proyectos ya existen. ¿Que quiero decir con esto? Bueno, creo que la mayoría de desarrolladores en la era de las grandes documentaciones simplemente abusan de la superficialidad que estas nos permiten. Y creo que esto puede estar bien en cierto modo, pero también creo que son las grandes implementaciones las que, en última instancia, nos hacen crecer como profesionales.

Es por esto que en la documentación del proyecto que quiero pseudodocumentar hoy empieza con una de las frases más conocidas por el homo-developer. "Oh, no way... another Dependency Injection container written in PHP?". Pues me temo

@brownl
brownl / markdown.css
Last active August 29, 2015 14:18 — forked from imjasonh/markdown.css
* {
font-size: 12pt;
font-family: monospace;
font-weight: normal;
font-style: normal;
text-decoration: none;
color: black;
cursor: default;
}
@solilokiam
solilokiam / reactive2017_lightning_talk.md
Last active August 27, 2023 14:22
React and 7.5 Million Daily Users | Proposal for lightning talk at Reactive Conf 2017

This is a proposal for a ⚡lightning talk at the Reactive 2017 conference.

🌟 Please star it so we can make it to the top 10 and be choosen to make it.

React and 7.5 Million Daily Users

1 year ago our design team came with the idea of redesigning our frontend... We decided to do it with React. One year later and some millions of satisfied users it's time to share the amazing and hard lessons we have learned. Some of those lessons are about:

  • SSR and SPA SEO

Godot Scene Manager

Simple scene manager with simple transition effects using RPG Maker greyscale images. Doesn't do async loading at all, but that's fine for small games that just want a little pizzaz to their visuals. Just drop the file into your project and add it to your Autoloads. Then start doing SceneManager.change_scene('res://myscene.tscn') instead of get_tree().change_scene('res://myscene.tscn') and you'll be good to go.

@xphere
xphere / plugin.gd
Last active July 17, 2023 20:44
Empty template for a Godot 4.1 plugin in GDScript
@tool
extends EditorPlugin
func _enter_tree() -> void:
pass
func _exit_tree() -> void:
pass
func _apply_changes() -> void: