Skip to content

Instantly share code, notes, and snippets.

{
"user": {
"method": "GET",
"url": "/user/1/",
},
"cart": {
"method": "GET",
"url": "/cart/1/",
},
"log": {
@meric
meric / gist:a77f6633e023310be114
Created April 2, 2015 01:35
immstruct building pattern
// Content.js
Content.construct = function(statics, cursor, {country}) {
cursor = cursor.update(() => Immutable.fromJS({
country: (country || ""),
url: statics.routePath,
}))
return new Promise((resolve, reject) =>
setTimeout(() => resolve("Hello World"), 500))
.then((value) => cursor.cursor('world').update(() => value))
}
1995-01-01 @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
1995-03-01 @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
1995-05-01 @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
1995-07-01 @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
1995-09-01 @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
1995-11-01 @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
1996-01-01 @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
1996-03-01 @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
1996-05-01 @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
1996-07-01 @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
1995-01-01 @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
1995-03-01 @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
1995-05-01 @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
1995-07-01 @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
1995-09-01 @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
1995-11-01 @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
1996-01-01 @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
1996-03-01 @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
1996-05-01 @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
1996-07-01 @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@meric
meric / vector.c
Created March 19, 2011 05:53
demo of sample size and vector types.
#include "stdio.h"
/* a size type */
typedef struct
{
int width;
int height;
} size;
/* create a new size */
#include "minefield.h"
#include "util.h"
#include "size.h"
#include "vector.h"
#include "spot.h"
/* create a new minefield */
minefield minefield_new(size s)
{
#include "util.h"
#include "vector.h"
#include "spot.h"
#ifndef MINEFIELD_H
#define MINEFIELD_H
/* define a minefield type */
typedef struct
{
@meric
meric / svg.lm
Created March 14, 2012 00:11
Sample lex file
%{
#import <Foundation/Foundation.h>
#import <stdlib.h>
#import "SVGBase.h"
#import "SVGLength.h"
#import "SVGAngle.h"
#import "y.tab.h"
void yyerror(char *);
%}
@meric
meric / base.py.diff
Created September 13, 2012 11:26
git diff 2ef7d14040a261fe284a8b72490712d4019a5766__base.py base.py
diff --git a/2ef7d14040a261fe284a8b72490712d4019a5766__base.py b/base.py
index d0a4b63..4c4d9eb 100644
--- a/2ef7d14040a261fe284a8b72490712d4019a5766__base.py
+++ b/base.py
@@ -114,25 +114,23 @@ class BaseHandler(object):
response = middleware_method(request, callback, callback_args, callback_kwargs)
if response:
break
-
- if response is None:
➜ test echo "$(curl -fksSL https://raw.github.com/gist/2394281/luadist.sh)" | bash