Skip to content

Instantly share code, notes, and snippets.

View carlozamagni's full-sized avatar
🎯
Focusing

Carlo Zamagni carlozamagni

🎯
Focusing
  • Technogym
  • Bologna
View GitHub Profile
__author__ = 'cazamagni'
import time
from threading import BoundedSemaphore, Lock, Thread
class Worker(Thread):
def __init__(self, function, semaphore):
Thread.__init__(self)
self.func = function
@carlozamagni
carlozamagni / Material-Design-Spinner.markdown
Created September 13, 2014 10:08
A Pen by Casper Pascal.
@carlozamagni
carlozamagni / background.css
Last active August 29, 2015 14:06
Css for nice background gradients (see: http://uigradients.com/)
/*
ServQuick
Colour 1: #485563
Colour 2: #29323c
*/
background: -webkit-linear-gradient(90deg, #485563 10%, #29323c 90%); /* Chrome 10+, Saf5.1+ */
background: -moz-linear-gradient(90deg, #485563 10%, #29323c 90%); /* FF3.6+ */
background: -ms-linear-gradient(90deg, #485563 10%, #29323c 90%); /* IE10 */
background: -o-linear-gradient(90deg, #485563 10%, #29323c 90%); /* Opera 11.10+ */
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
Version 2, December 2014
Copyright (C) 2014 Addy Osmani @addyosmani
Everyone is permitted to copy and distribute verbatim or modified
copies of this license document, and changing it is allowed as long
as the name is changed.
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE

Update and install required packages:

$ apt-get update -y
$ apt-get install -y g++ gcc make libc6-dev patch openssl ca-certificates libreadline6 libreadline6-dev curl zlib1g zlib1g-dev libssl-dev libyaml-dev libsqlite3-dev sqlite3 libxml2-dev libxslt1-dev autoconf libc6-dev libgdbm-dev libncurses5-dev automake libtool bison pkg-config libffi-dev

Install ruby-build

$ git clone git://github.com/sstephenson/ruby-build.git /tmp/ruby-build
$ cd /tmp/ruby-build/

$ ./install.sh

// ----- C -------
/**
* arduino Nikon IR remote
* @license Creative commons: Attribution-Noncommercial-Share Alike 3.0 (http://creativecommons.org/licenses/by-nc-sa/3.0/)
* @author Aurelien ANTOINE
* version 1
* date 20081217
*
*
* This version modified by Steve Hoefer September 12, 2011
@carlozamagni
carlozamagni / GoMgoSample-1.go
Last active August 29, 2015 14:27 — forked from ardan-bkennedy/GoMgoSample-1.go
Sample Go and MGO example
type (
// BuoyCondition contains information for an individual station.
BuoyCondition struct {
WindSpeed float64 `bson:"wind_speed_milehour"`
WindDirection int `bson:"wind_direction_degnorth"`
WindGust float64 `bson:"gust_wind_speed_milehour"`
}
// BuoyLocation contains the buoy's location.
BuoyLocation struct {
@carlozamagni
carlozamagni / LICENSE
Last active September 18, 2015 12:59 — forked from kesor/LICENSE
Making Amazon AWS API Queries
Copyright (c) 2013, Evgeny Zislis
All rights reserved.
Redistribution and use in source and binary forms, with or without modification,
are permitted provided that the following conditions are met:
* Redistributions of source code must retain the above copyright notice,
this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright notice,
@carlozamagni
carlozamagni / .Title
Last active September 20, 2015 19:45 — forked from congjf/.Title
Using MongoDB in golang with mgo
Using MongoDB in golang with mgo
@carlozamagni
carlozamagni / swift_package_merger.py
Last active October 22, 2015 15:58
Merges auto generated code from multiple files into a single swift class
import os
__author__ = 'carlozamagni'
BASE_PATH = os.getcwd()
def merge_files(path, package_name):
files = [f for f in os.listdir(path) if os.path.isfile(os.path.join(path,f))]