Skip to content

Instantly share code, notes, and snippets.

View pbosetti's full-sized avatar
:octocat:

Paolo Bosetti pbosetti

:octocat:
View GitHub Profile
@pbosetti
pbosetti / edison-x-compile.md
Last active October 17, 2016 07:05
Intel edison cross compiling tricks on OS X
@rxin
rxin / ramdisk.sh
Last active December 13, 2023 02:40
ramdisk create/delete on Mac OS X.
#!/bin/bash
# From http://tech.serbinn.net/2010/shell-script-to-create-ramdisk-on-mac-os-x/
#
ARGS=2
E_BADARGS=99
if [ $# -ne $ARGS ] # correct number of arguments to the script;
then
#!/usr/bin/env ruby
require "strscan"
TAB = " "
class StringScanner
def scan_and_put(match)
puts scan_until(match).gsub(/\t/, TAB)
end
end
@hendrikswan
hendrikswan / app.rb
Created December 20, 2011 21:29
sample sinatra mongodb service
require 'sinatra'
require 'mongoid'
require 'json'
require "sinatra/reloader" if development?
Mongoid.load!("mongoid.yml")
class Price
include Mongoid::Document
@pbosetti
pbosetti / shared.rb
Created April 28, 2011 18:35
IPC shared memory access via FFI
#!/usr/bin/env ruby
# untitled.rb
# Created by Paolo Bosetti on 2011-04-22.
# Copyright (c) 2011 University of Trento. All rights reserved.
require "rubygems"
require 'ffi'
module Shared
@pbosetti
pbosetti / timer.rb
Created April 21, 2011 01:56
Recurring process triggered by SIGALARM via ualarm FFI mapping
#!/usr/bin/env ruby
# untitled.rb
# Created by Paolo Bosetti on 2011-04-20.
# Copyright (c) 2011 University of Trento. All rights reserved.
require "rubygems"
require 'ffi'
class Array
def mean
@lukebayes
lukebayes / ERBResolver
Created October 21, 2009 16:55
A Rake Task that makes it stupid-easy to render ERB templates to disk
##################################
# MIT LICENSE
# Copyright (C) 2012 Luke Bayes
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions: