Skip to content

Instantly share code, notes, and snippets.

View ricogallo's full-sized avatar

Riccardo Gueli Alletti ricogallo

View GitHub Profile
#include <stdio.h>
#define coroutine_begin() static int state=0; switch(state) { case 0:
#define coroutine_return(x) { state=__LINE__; return x; case __LINE__:; }
#define coroutine_finish() }
int get_next(void) {
static int i = 0;
coroutine_begin();
while (1){
set hidden
set nocompatible
set nu
set expandtab
set splitright
set shiftwidth=2
set laststatus=2
set hlsearch
set encoding=utf-8
set softtabstop=2
#
# to make it work use the multithreaded version like `make -j4`
#
BINPATH = ./node_modules/.bin
SRCDIR = src
TARGETDIR = dist
SUBDIRS = $(SRCDIR) $(TARGETDIR) $(BINPATH)
JSSRC = $(shell find $(SRCDIR)/js -type f -name '*.js')
CSSSRC = $(SRCDIR)/css/main.css
JSTARGET = $(TARGETDIR)/app.js
<link rel="import" href="../core-scaffold/core-scaffold.html">
<link rel="import" href="../core-header-panel/core-header-panel.html">
<link rel="import" href="../core-menu/core-menu.html">
<link rel="import" href="../core-item/core-item.html">
<link rel="import" href="../core-icon-button/core-icon-button.html">
<link rel="import" href="../core-toolbar/core-toolbar.html">
<link rel="import" href="../core-menu/core-submenu.html">
<link rel="import" href="../google-map/google-map.html">
<polymer-element name="my-element">
@ricogallo
ricogallo / module.js
Last active December 16, 2015 03:49
Universally loadable module
// Universally loadable script, drawn from https://github.com/kriskowal/q
(function (definition) {
// Montage Require
if (typeof bootstrap === "function") {
bootstrap("promise", definition);
// CommonJS
} else if (typeof exports === "object") {
module.exports = definition();
@ricogallo
ricogallo / gist:4186700
Created December 2, 2012 02:49
async http get from @merbivore, now refactored away
package main
import (
"fmt"
"net/http"
)
var urls = []string{
"http://www.google.com/",
"http://www.facebook.com/",
class window.ServicesView extends CommonView
SLOGAN_PLACEHOLDER: 'Enter a Slogan here. Sell your skills in a sentence.'
template: =>
"""
<div el="slogan_wrap">
<span el="counter"></span>
<textarea el="slogan"
class window.Application extends Page
bind: ->
@facebook_app_id = $("meta[property='fb:app_id']").attr('content')
@app_url = window.location.protocol + "//" + window.location.host
@authenticity_token = $('meta[name="csrf-token"]').attr('content')
new Cities