Skip to content

Instantly share code, notes, and snippets.

View 5v3n's full-sized avatar

Sven Kräuter 5v3n

View GitHub Profile
sys = require 'sys'
class MyMath
square: (x) ->
x * x
cube: (x) ->
this.square(x) * x
#let's get something rolling:
myMath = new MyMath
x = 3
#mind the nice string processing:
sys = require 'sys'
#oo love:
class MyMath
square: (x) ->
x * x
cube: (x) ->
this.square(x) * x
#functional love:
printSquare = (number_to_process) ->
"square(#{number_to_process}) = #{myMath.square(number_to_process)}" #<- why does this work? myMath should be out of scope in here!
var MyMath, myMath, sys, x;
sys = require('sys');
MyMath = function() {};
MyMath.prototype.square = function(x) {
return x * x;
};
MyMath.prototype.cube = function(x) {
return this.square(x) * x;
};
myMath = new MyMath();
@5v3n
5v3n / .rvmrc
Created November 7, 2010 10:28
Gemfile & .rvmrc for schacon/showoff
rvm ree@showoff
@5v3n
5v3n / .vimrc
Created November 16, 2010 19:08
basic .vimrc
if has("autocmd")
filetype plugin indent on
endif
set sw=2
set sts=2
set background=dark
set cindent
set smartindent
set autoindent
set expandtab
require 'rubygems'
require 'fileutils'
require 'pathname'
require 'ruby-debug'
require 'ostruct'
require 'rest_client'
require 'json'
# multiple gems use the require tumblr, this one refers to http://github.com/mwunsch/tumblr
# note that ruby-debug and the weary lib, which makes reqs for this tumblr gem, don't play nicely together
// Controlling the modulation of an LED using a potentiometer (variable resistor)
int ledpin = 3; // light connected to digital pin 3
int potpin = A3; // analog pin used to connect the potentiometer
int sensorValue, outputValue; // variables to read the values
void setup()
{
// initialize serial communications at 9600 bps:
Serial.begin(9600);
@5v3n
5v3n / Gemfile
Created May 4, 2011 06:29
Makeshift fix for tweetlr issue #2 - missing curb dependency
source :rubygems
gem 'curb'
gem 'tweetlr'
@5v3n
5v3n / Gemfile
Created September 30, 2011 12:33
supporting oirukan ;-)
source :rubygems
gem 'oirukan', :git => "git://github.com/filtercake/oirukan.git"
@5v3n
5v3n / README.MD
Created December 30, 2011 21:11 — forked from wynst/README.MD
A Thor Task to unwatch *all* Github watched repositories (excluding owned) and optionally export to delicious.

A Thor Task to unwatch all Github watched repositories (excluding owned) and optionally export to delicious.

Sorry Github, for I have sinned. I use the Watch feature as a bookmarker.

Install required gems:

 `gem install thor rest-client`

Install this script in Thor: