Skip to content

Instantly share code, notes, and snippets.

<?php
/**
* @ORM\Entity
*/
class User
{
/**
* @ORM\String
*/
#!/usr/bin/env php
<?php
$files = glob('Templates/*.tmpl');
$templates = array();
foreach($files as $file) {
$data = file_get_contents($file);
/// Macro emulating `do`-notation for the parser monad, automatically threading the linear type.
///
/// ```ignore
/// parse!{input;
/// parser("parameter");
/// let value = other_parser();
///
/// ret do_something(value);
/// }
/// // equivalent to:
#[macro_use]
extern crate nom;
use nom::IResult;
use std::env;
use std::fs::File;
#[derive(Debug)]
struct Request<'a> {
extern crate combine;
use combine::*;
use combine::primitives::Error;
use combine::combinator::take_while1;
use std::fs::File;
use std::env;
@m4rw3r
m4rw3r / nom_many1_fix_incomplete.diff
Created November 27, 2015 16:42
Nom: Fix for many1 not propagating incomplete state
diff --git a/src/macros.rs b/src/macros.rs
index 7ea9fbd..607ab25 100644
--- a/src/macros.rs
+++ b/src/macros.rs
@@ -1712,14 +1712,27 @@ macro_rules! many1(
{
let mut res = Vec::new();
let mut input = $i;
- while let $crate::IResult::Done(i,o) = $submac!(input, $($args)*) {
- if i.len() == input.len() {
@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);
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]);
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
@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