Skip to content

Instantly share code, notes, and snippets.

@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
➜ _bootstrap git:(master) cmake .
-- Configuring done
-- Generating done
-- Build files have been written to: /Users/Eric/test/_bootstrap
➜ _bootstrap git:(master) ✗ make
Scanning dependencies of target lua
[ 0%] Creating directories for 'lua'
[ 0%] No download step for 'lua'
[ 0%] No patch step for 'lua'
[ 0%] No update step for 'lua'
// Code goes here
var testApp = angular.module('testApp', ['restangular'])
.config(function(RestangularProvider){
RestangularProvider.setBaseUrl("http://localhost/");
RestangularProvider.setRequestSuffix('/');
})
.controller('MainCtrl', function() {
})
<!DOCTYPE html>
<html>
<body ng-app="testApp">
<h1>Hello Plunker!</h1>
<script src="http://cdn.jsdelivr.net/underscorejs/1.5.1/underscore-min.js"></script>
<script src="http://code.angularjs.org/1.2.0rc1/angular.js"></script>
<script src="https://raw.github.com/mgonto/restangular/master/dist/restangular.min.js"></script>
<script>
// Code goes here
var testApp = angular.module('testApp', ['restangular'])
{
"user": {
"method": "GET",
"url": "/user/1/",
},
"cart": {
"method": "GET",
"url": "/cart/1/",
},
"log": {