Skip to content

Instantly share code, notes, and snippets.

View orlin's full-sized avatar

Orlin M Bozhinov orlin

  • Astrolet
  • Varna, Bulgaria
  • X @orlin
View GitHub Profile
@iamkvein
iamkvein / hook_method.js
Created March 9, 2012 14:32
Improved way of temporarily replacing a method on an object
var install_hook_to = function(obj) {
if (obj.hook || obj.unhook) {
throw new Error('Object already has properties hook and/or unhook');
}
obj.hook = function(_meth_name, _fn, _is_async) {
var self = this,
meth_ref;
@erikh
erikh / hack.sh
Created March 31, 2012 07:02 — forked from DAddYE/hack.sh
OSX For Hackers
#!/usr/bin/env sh
##
# This is script with usefull tips taken from:
# https://github.com/mathiasbynens/dotfiles/blob/master/.osx
#
# install it:
# curl -sL https://raw.github.com/gist/2108403/hack.sh | sh
#
@bobby
bobby / datomic-helpers.clj
Created July 20, 2012 14:12
Some Datomic helpers I sometimes use with ring or pedestal-service apps
(ns datomic-helpers
(:require [datomic.api :as d]))
;;; Expose Datomic vars here, for convenience
;;; Ring middleware
(defn wrap-datomic
"A Ring middleware that provides a request-consistent database connection and
value for the life of a request."
@adammw
adammw / README.md
Created August 3, 2012 06:30
Node.js for Raspberry Pi

Node.js for Raspberry Pi

Pre-built binaries

Recent releases have been pre-built using cross-compilers and this script and are downloadable below.

If you have found these packages useful, give me a shout out on twitter: @adammw

@lukegalea
lukegalea / templateCompiler.js
Created August 8, 2012 01:25
JADE Embedded Handlebars Precompiler
// Renders JADE -> Handlebars, Precompiles and outputs a single template bundle
// For example, https://github.com/lukegalea/recur_in/blob/master/templates/task.jade
// Dependencies
var handlebars = require('handlebars');
var fs = require('fs');
var async = require('async');
var jade = require('jade');
var uglify = require('uglify-js');
var encoder = require('./encoder');

These instructions work for the Raspberry Pi running Raspbian (hard float) and create a hardware optimized version of NodeJS for the Raspberry PI, (and include a working install and NPM!!!):

  1. Install Raspbian - http://www.raspberrypi.org/downloads

  2. Install the necessary dependecies:

sudo apt-get install git-core build-essential

(If you just installed git then you need to administer your git identity first, else adding the patches below will fail!!!)

@martintrojer
martintrojer / cl-graph.clj
Last active October 11, 2015 02:57
core.logic graph blog
(ns cl-graph
(:refer-clojure :exclude [==])
(:use clojure.core.logic))
;; Directed Acyclic Graphs
(defrel edge a b)
;; a
;; |
/*
* RSS Subscription Count Node.js Proxy Server
* Devon Govett
* Public Domain
*
* This script is a simple proxy server for my blog's RSS feed that keeps track of requests
* to the feed and attempts to guess a subscriber count.
* Google Reader represents the majority of my subscriber base, and they give you actual
* subscriber numbers when their spider requests your feed. Other aggregators do something similar.
* Otherwise, this script tracks unique IP addresses over a 24 hour period.
@disnet
disnet / annotate.js
Created October 16, 2012 21:19
parameter annotations (type, contract, etc.) in sweet.js
macro def {
case $name:ident ( $($params:ident : $type:ident) (,) ...) $body => {
// just throwing away the type annotation. The semantics of type
// annotations left as an exercise to the reader :)
function $name ($params (,) ...) $body
}
}
def add (a : Number, b : Number) {
return a + b;
@gnunicorn
gnunicorn / Tech Internationals Guide to the Berlin Startup Szene.md
Last active December 14, 2015 11:49
Tech Internationals Guide to the Berlin Startup Szene

Introduction

Well, well, well. So you decided to go to/check out/move to Berlin, Germany, because of its vivid startup scene, he? Alright then, good for you, because there seriously is something going on here. And as I was helping quite a few people to settle in here in the startup scene over the last couple of years, I decided to put all this into this little guide. If you have anything to add: please feel free to make a pull request or use the comments section below.

Disclaimer:

This is totally personally and opinionated and as such doesn't even try to be complete. At all. Don't try this argument on me. This is what I personally recommend everyone, who asks me about. I'll try to keep it up to date, but you better look at the timestamp before going anywhere ;) .

Stay up to date

The first thing you need to do, is to subscribe to the two most important tech-startup-newsletters for Berlin: