Skip to content

Instantly share code, notes, and snippets.

echo 'export PATH=$HOME/local/bin:$PATH' >> ~/.bashrc
. ~/.bashrc
mkdir ~/local
mkdir ~/node-latest-install
cd ~/node-latest-install
curl http://nodejs.org/dist/node-latest.tar.gz | tar xz --strip-components=1
./configure --prefix=~/local
make install
curl http://npmjs.org/install.sh | sh
module FFI
module Library
TYPE_MAP = {
:string => DL::TYPE_VOIDP,
:pointer => DL::TYPE_VOIDP,
}
DL.constants.each do |const|
next unless const.to_s =~ /^TYPE_/
module Tidy
extend FFI::Library
ffi_lib "libtidy.dylib"
attach_function :tidyFileExists, [:string], :int
attach_function :tidyCreate, [], :pointer
attach_function :tidyParseString, [:pointer, :string], :int
attach_function :tidySaveStdout, [:pointer], :int
end
eferraiuolo@BlackMagic ~/Tools/node $ npm install zombie
npm info it worked if it ends with ok
npm info using npm@0.2.13-3
npm info using node@v0.3.3
npm info preinstall base64@1.0.1
npm info preinstall cssom@0.2.0
npm info preinstall mime@1.1.0
npm info preinstall zombie@0.8.8
npm info install base64@1.0.1
Checking for program g++ or c++ : /usr/bin/g++
require 'net/http'
require 'rubygems'
require 'nokogiri'
url = URI.parse 'http://memegenerator.net/Instance/CreateOrEdit'
res = Net::HTTP.post_form(url, {
'templateType' => 'AdviceDogSpinoff',
'text0' => ARGV[0],
'text1' => ARGV[1],
'templateID' => '165241',
@nouse
nouse / zombie-test.coffee
Created March 21, 2011 05:42
vows of zombie
zombie = require("zombie")
assert = require("assert")
vows = require('vows')
vows.describe('vows of zombie').addBatch(
'when visit home page' :
topic : -> zombie.visit("http://localhost:3000", @callback)
'title should be correct' : (err, browser, status) ->
assert.equal(browser.text("title"), "Correct Title")
@hosiawak
hosiawak / irb_session.rb
Created June 12, 2011 12:53
Rubinius AST transform by sublassing Melbourne
# The goal is to not use the regular Symbol#to_proc
# (which is to_proc method in the Symbol class)
# but rather use an Abstract Syntax Tree transformation to
# transform map(&:to_s) into map {|x| x.to_s}
# This can be achieved by using the flexible compiler architecture
# in Rubinius and is presented below.
#
# First we undefine the regular Symbol#to_proc
class Symbol
@alloy
alloy / gist:7527832
Created November 18, 2013 13:39
VIM config to deal with (MRI) Ruby’s C source code indentation.
" These VIM rules match the MRI C indentation rules.
"
" To enable use of this project specific config, add the following to your
" ~/.vimrc:
"
" " Enable per-directory .vimrc files
" set exrc
" " Disable unsafe commands in local .vimrc files
" set secure
require 'fiddle'
require 'minitest/autorun'
class RubyVM
class InstructionSequence
address = Fiddle::Handle::DEFAULT['rb_iseq_load']
func = Fiddle::Function.new(address, [Fiddle::TYPE_VOIDP] * 3, Fiddle::TYPE_VOIDP)
define_singleton_method(:load) do |data, parent = nil, opt = nil|
func.call(Fiddle.dlwrap(data), parent, opt).to_value
@jeffkreeftmeijer
jeffkreeftmeijer / README.textile
Created November 14, 2010 23:25
A stupid RSpec formatter that prints FFFUUU instead of FFFFF. Heh.

FffuuuFormatter

A stupid RSpec formatter that prints FFFUUU instead of FFFFF. Heh.

Installation

Throw it in a file and run your specs like this:

$ rspec -r path/to/fffuuu_formatter.rb -f FffuuuFormatter spec/