Skip to content

Instantly share code, notes, and snippets.

View makevoid's full-sized avatar

Francesco 'makevoid' Canessa makevoid

View GitHub Profile
@makevoid
makevoid / Readme.md
Created June 16, 2012 12:39
Hello meteor with coffeescript

Prereqs:

  • node and npm
  • coffee-script npm package

Install meteor:

curl install.meteor.com | /bin/sh

Clone/copy these files into a directory

@makevoid
makevoid / app_delegate.rb
Last active October 4, 2015 06:48
Hello Button in RubyMotion (a bit more than hello world)
# Hello ButtonView (world)
class AppDelegate
def application(application, didFinishLaunchingWithOptions:launchOptions)
@window = UIWindow.alloc.initWithFrame(UIScreen.mainScreen.bounds)
@window.rootViewController = ButtonViewController.alloc.init
@window.makeKeyAndVisible
return true
end
end
@makevoid
makevoid / index.html
Created April 26, 2012 12:52
usermedia and webrtc chrome test
<html>
<head>
<script type="text/javascript">
function onFailSoHard() {
console.log("fail")
}
function sendSignalingChannel(message) {
var xhr = new XMLHttpRequest();
xhr.open('POST', path, true);
@makevoid
makevoid / sinatrize.rb
Last active October 3, 2015 03:57
Sinatrize, generates a base sinatra app
# Sinatrize
# usage:
#
# mkdir -p yourapp
# cd yourapp
# wget https://gist.githubusercontent.com/makevoid/2385559/raw/1fc0355a04ed2153d74b06386048d1e1541a0706/sinatrize.rb # if you are not sure get the latest gist by clicking on [Raw]
# ruby sinatrize.rb
# rm -f sinatrize.rb
# bundle
@makevoid
makevoid / config.ru
Created April 9, 2012 23:50
Rack Tidy FFI Sinatra Example
require 'rack-tidy-ffi'
require 'sinatra'
use RackTidyFFI
class MyApp < Sinatra::Base
get "/" do
"<div>aaaa<div>bbb</div><div>"
end
end
@makevoid
makevoid / hack.sh
Created April 5, 2012 09:19 — forked from erikh/hack.sh
OSX For Hackers
#!/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
@makevoid
makevoid / nginx.sh
Created February 29, 2012 01:52
nginx init.d file for centos/rhel - /etc/init.d/nginx
#!/bin/sh
#
# nginx - this script starts and stops the nginx daemon
#
# chkconfig: - 85 15
# description: Nginx is an HTTP(S) server, HTTP(S) reverse \
# proxy and IMAP/POP3 proxy server
# processname: nginx
# config: /etc/nginx/nginx.conf
# config: /etc/sysconfig/nginx
@makevoid
makevoid / img_resize.js
Created January 23, 2012 00:29
Resize Images with Canvas on the clientside
var settings = {
max_width: 600,
max_height: 200
}
resize_image = function(img){
var ctx = canvas.getContext("2d")
var canvasCopy = document.createElement("canvas")
var copyContext = canvasCopy.getContext("2d")
@makevoid
makevoid / README.md
Created January 17, 2012 22:29
Thorrents.com JSONP embedded search example

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:

  • Remove first and last line and paste this where you want it in the <body/>.
  • Change query to whatever you want to search (and maybe change limit).
@makevoid
makevoid / Gemfile
Created November 21, 2011 00:05
dm constraints belongs_to "Can't create table 'dm_constraints.#sql-" bug
def github(gem)
"git@github.com:datamapper/#{gem}"
end
def gh_gem(gem)
gem gem, git: github(gem)
end
%w(dm-core dm-constraints dm-migrations dm-do-adapter dm-mysql-adapter).each do |g|
gh_gem g