This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
" 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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# A queue that you can pass to IO.select. | |
# | |
# NOT THREAD SAFE: Only one thread should write; only one thread should read. | |
# | |
# Purpose: | |
# Allow easy integration of data-producing threads into event loops. The | |
# queue will be readable from select's perspective as long as there are | |
# objects in the queue. | |
# | |
# Implementation: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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 | |
# |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# autoload concerns | |
module YourApp | |
class Application < Rails::Application | |
config.autoload_paths += %W( | |
#{config.root}/app/controllers/concerns | |
#{config.root}/app/models/concerns | |
) | |
end | |
end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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") |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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', |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
eferraiuolo@BlackMagic ~/Tools/node $ npm install zombie | |
npm info it worked if it ends with ok | |
npm info using [email protected] | |
npm info using [email protected] | |
npm info preinstall [email protected] | |
npm info preinstall [email protected] | |
npm info preinstall [email protected] | |
npm info preinstall [email protected] | |
npm info install [email protected] | |
Checking for program g++ or c++ : /usr/bin/g++ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
NewerOlder