Skip to content

Instantly share code, notes, and snippets.

@m4rw3r
m4rw3r / header.rs
Last active January 13, 2016 06:19
http.rs: Simple HTTP-library for Rust
use std::fmt;
use std::ascii::StrAsciiExt;
#[deriving(Clone,Eq)]
pub enum HeaderName {
Accept,
AcceptCharset,
AcceptEncoding,
AcceptLanguage,
Age,
<?php
class F
{
protected $f;
protected $params = array();
public function __construct(callable $c, array $params = null)
{
$this->f = $c;
@m4rw3r
m4rw3r / test.php
Created November 15, 2013 09:29
Dirty start implementation of a data-structure parser for a modular Dependency Injection container
<?php
namespace ModContainer {
use RuntimeException;
class ParseException extends RuntimeException {}
class PathException extends RuntimeException {}
class Module
@m4rw3r
m4rw3r / gist:7457187
Last active December 28, 2015 06:29
Quick attempt at writing some CommonJS-like configuration for a dependency injection container
<?php
$module->use('db');
$module->use(new Parameter('table'));
$module->import('logger', 'logger', ['name': new Parameter('log_name')]);
$module->addParameter('log_name', 'UserLog');
$module->addService('users', new ClassService('UserProvider',
=====================================================================
EXPECTED FAILED TEST SUMMARY
---------------------------------------------------------------------
Inconsistencies when accessing protected members [Zend/tests/access_modifiers_008.phpt] XFAIL REASON: Discussion: http://marc.info/?l=php-internals&m=120221184420957&w=2
Inconsistencies when accessing protected members - 2 [Zend/tests/access_modifiers_009.phpt] XFAIL REASON: Discussion: http://marc.info/?l=php-internals&m=120221184420957&w=2
Bug #48770 (call_user_func_array() fails to call parent from inheriting class) [Zend/tests/bug48770.phpt] XFAIL REASON: See Bug #48770
Bug #48770 (call_user_func_array() fails to call parent from inheriting class) [Zend/tests/bug48770_2.phpt] XFAIL REASON: See Bug #48770
Bug #48770 (call_user_func_array() fails to call parent from inheriting class) [Zend/tests/bug48770_3.phpt] XFAIL REASON: See Bug #48770
Bug #63336 (invalid E_NOTICE error occur) [Zend/tests/bug63336.phpt] XFAIL REASON: Bug is not fi
=====================================================================
EXPECTED FAILED TEST SUMMARY
---------------------------------------------------------------------
Test script to verify that magic methods should be called only once when accessing an unset property. [tests/classes/bug63462.phpt] XFAIL REASON: Bug 63462 is not yet fixed
Test open_basedir configuration [tests/security/open_basedir_linkinfo.phpt] XFAIL REASON: BUG: open_basedir cannot delete symlink to prohibited file. See also
bugs 48111 and 52176.
Inconsistencies when accessing protected members [Zend/tests/access_modifiers_008.phpt] XFAIL REASON: Discussion: http://marc.info/?l=php-internals&m=120221184420957&w=2
Inconsistencies when accessing protected members - 2 [Zend/tests/access_modifiers_009.phpt] XFAIL REASON: Discussion: http://marc.info/?l=php-internals&m=120221184420957&w=2
Bug #48770 (call_user_func_array() fails to call parent from inheriting class) [Zend/tests/bug48770.phpt] XFAIL REASON: See Bug #48770
Bug #48770 (call_
@m4rw3r
m4rw3r / .vimrc.vim
Last active December 14, 2015 11:39
" General {
set nocompatible
set encoding=utf-8
set fileencoding=utf-8
set fileencodings=ucs-bom,utf-8
" Display incomplete commands
set showcmd
" Allow switching buffsers without saving changes to file
set hidden
" Don't add invisible linebreak at EOF
Best match: Twisted 12.3.0
Downloading http://pypi.python.org/packages/source/T/Twisted/Twisted-12.3.0.tar.bz2#md5=6e289825f3bf5591cfd670874cc0862d
Processing Twisted-12.3.0.tar.bz2
Running Twisted-12.3.0/setup.py -q bdist_egg --dist-dir /tmp/easy_install-Lk6904/Twisted-12.3.0/egg-dist-tmp-9gKNEf
/usr/libexec/gcc/powerpc-apple-darwin10/4.2.1/as: assembler (/usr/bin/../libexec/gcc/darwin/ppc/as or /usr/bin/../local/libexec/gcc/darwin/ppc/as) for architecture ppc not installed
Installed assemblers are:
/usr/bin/../libexec/gcc/darwin/ppc64/as for architecture ppc64
/usr/bin/../libexec/gcc/darwin/x86_64/as for architecture x86_64
/usr/bin/../libexec/gcc/darwin/i386/as for architecture i386
conftest.c:1: fatal error: error closing -: Broken pipe
var map = function(args, mapFunc)
{
var d = new Deferred(),
length = args.length,
results = [],
resolved = 0;
var mapLoop = function(i) {
var arg = typeof args[i].then == 'function' ? args[i] : new Resolved(args[i]);
@m4rw3r
m4rw3r / Promise 0.1.js
Last active December 10, 2015 12:38
Minimalistic CommonJS Promises/A implementation fulfilling all the tests in https://github.com/domenic/promise-tests and also all tests in https://github.com/promises-aplus/promises-tests
(function() {
/**
* Defers the execution of func to the next tick.
*
* @param function
*/
var deferFunc = this.nextTick
? this.nextTick
: function(func) {
setTimeout(func, 0);