Skip to content

Instantly share code, notes, and snippets.

View rizo's full-sized avatar

Rizo rizo

  • Porto (Portugal)
View GitHub Profile
@rizo
rizo / gist:7517044
Last active December 28, 2015 14:49 — forked from idan/gist:3135754

Hello there! This is a sample post for gist.io, a super-lightweight writing soapbox for hackers.

Now look up. Further. Above the post title. See that grey text with the gist ID?

What about some Ruby code:

rb() {
  if [[ $# -lt 1 ]]; then
 rbenv shell --unset

Installation

FreeBSD

portmaster irc/irssi
portmaster irc/irssi-xmpp

OS X

brew install irssi

@rizo
rizo / gist:5016902
Last active December 14, 2015 02:49 — forked from anonymous/gist:5016843
int ledPin = 9;    // LED connected to digital pin 9
void setup()  {
 // nothing happens in setup
}
void loop()  {
 // fade in from min to max in increments of 5 points:
 for(int fadeValue = 0 ; fadeValue <= 255; fadeValue +=5) {
   // sets the value (range from 0 to 255):
// http://rentzsch.tumblr.com/post/40806448108/ns-poor-mans-namespacing-for-objective-c
#ifndef NS
#ifdef NS_NAMESPACE
#define JRNS_CONCAT_TOKENS(a,b) a##_##b
#define JRNS_EVALUATE(a,b) JRNS_CONCAT_TOKENS(a,b)
#define NS(original_name) JRNS_EVALUATE(NS_NAMESPACE, original_name)
#else
#define NS(original_name) original_name
#endif
#endif
@rizo
rizo / stringtemplate.d
Created May 22, 2012 22:30 — forked from martindemello/stringtemplate.d
string templating in D
// first version - code demonstrating the basic idea.
// see below for a fuller-featured implementation
import std.string;
import std.range;
import std.stdio;
/* A very simple string templating system. Placeholders of the form
* %{variable} are replaced by the corresponding variable in the current
* scope.