if you don't have macruby and hotcocoa already:
rvm use macruby
gem i hotcocoa
ok then you can run:
hotcocoa webviewbasic
require 'net/http' | |
require 'uri' | |
# /api/v1/:format/new | |
# /api/v1/:format/gists/:user | |
# /api/v1/:format/:gist_id | |
res = Net::HTTP.post_form(URI.parse('http://gist.github.com/api/v1/xml/new'), | |
{ 'files[file1.ab]' => 'CONTNETS', | |
'files[file2.ab]' => 'contents' }) |
#!/usr/bin/env ruby | |
# Usage: gemspec [-s] GEMNAME | |
# | |
# Prints a basic gemspec for GEMNAME based on your git-config info. | |
# If -s is passed, saves it as a GEMNAME.gemspec in the current | |
# directory. Otherwise prints to standard output. | |
# | |
# Once you check this gemspec into your project, releasing a new gem | |
# is dead simple: | |
# |
# v 1.0.1 | |
~$ ARCHFLAGS='-arch i386 -arch x86_64' | |
~$ rvm install 1.8.7 --debug --reconfigure -C --enable-shared=yes | |
~$ wget http://sourceforge.net/projects/rubycocoa/files/RubyCocoa/1.0.1/RubyCocoa-1.0.1.tar.gz/download | |
~$ tar xzf RubyCocoa-1.0.1.tar.gz && rm RubyCocoa-1.0.1.tar.gz && cd RubyCocoa-1.0.1 | |
~/RubyCocoa-1.0.1$ ruby install.rb config --build-universal=yes | |
~/RubyCocoa-1.0.1$ ruby install.rb setup | |
~/RubyCocoa-1.0.1$ sudo ruby install.rb install |
Example of embedded http://thorrents.com search, and a tribute to Cory Doctorow ;) tnx to @thedod
See it live here.
If you want to embed this (or any other search) in an existing page:
<body/>
.query
to whatever you want to search (and maybe change limit
).#!/usr/bin/env sh | |
echo "Use current directory as default search scope in Finder" | |
defaults write com.apple.finder FXDefaultSearchScope -string "SCcf" | |
echo "Show Path bar in Finder" | |
defaults write com.apple.finder ShowPathbar -bool true | |
echo "Disable the Ping sidebar in iTunes" | |
defaults write com.apple.iTunes disablePingSidebar -bool true |
var parser = document.createElement('a'); | |
parser.href = "http://example.com:3000/pathname/?search=test#hash"; | |
parser.protocol; // => "http:" | |
parser.hostname; // => "example.com" | |
parser.port; // => "3000" | |
parser.pathname; // => "/pathname/" | |
parser.search; // => "?search=test" | |
parser.hash; // => "#hash" | |
parser.host; // => "example.com:3000" |
/*jslint node:true, vars:true, bitwise:true, unparam:true */ | |
/*jshint unused:false */ | |
/*global */ | |
var mraa = require('mraa'); //require mraa | |
var request = require('request'); | |
var _ = require('underscore') | |
var addr2watch = '1LJ4rddYGzT8GqwQioMNw3cYQJdwjM3Drs' // bitcoin address to watch | |
var assetName = 'PROG' |
// purchase a product with a credit card | |
purchase('productId') | |
.using( { | |
cc: "4556934156210213", | |
valid: "2016-10", | |
csc: "123" | |
} ) | |
// purchase a product with paypal | |
purchase('productId') |
# Usage: redis-cli publish message hello | |
require 'sinatra' | |
require 'redis' | |
conns = [] | |
get '/' do | |
erb :index | |
end |