Skip to content

Instantly share code, notes, and snippets.

View munshkr's full-sized avatar

Damián Silvani munshkr

  • Buenos Aires, Argentina
  • 19:42 (UTC -03:00)
  • X @munshkr
View GitHub Profile
# Sinatra minimalist RestMQ
# no COMET, just /q/ routes and queue logic
# the core of RestMQ is how it uses Redis' data types
require 'rubygems'
require 'sinatra'
require 'redis'
require 'json'
QUEUESET = 'QUEUESET' # queue index
@ofan
ofan / lisp.cpp
Last active October 23, 2024 10:37
Lisp interpreter in 90 lines of C++
Lisp interpreter in 90 lines of C++
I've enjoyed reading Peter Norvig's recent articles on Lisp. He implements a Scheme interpreter in 90 lines of Python in the first, and develops it further in the second.
Just for fun I wondered if I could write one in C++. My goals would be
1. A Lisp interpreter that would complete Peter's Lis.py test cases correctly...
2. ...in no more than 90 lines of C++.
Although I've been thinking about this for a few weeks, as I write this I have not written a line of the code. I'm pretty sure I will achieve 1, and 2 will be... a piece of cake!
require "test/unit"
Module.send :include, Module.new {
def test(name, &block)
define_method("test_#{name.gsub(/[^a-z0-9]/i, "_")}".to_sym, &block)
end
alias :should :test
}
module NumericTests
@JChristensen
JChristensen / AVR Sleep
Last active August 15, 2024 14:22
AVR microcontroller sleep demonstrations
Simple demonstrations of putting AVR microcontrollers to sleep in power-down mode,
which results in minimum current. Coded with Arduino IDE version 1.0.4 (and with
the Arduino-Tiny core for the ATtiny MCUs, http://code.google.com/p/arduino-tiny/)
For ATmega328P, ~0.1µA.
For ATtinyX5 revisions that implement software BOD disable, ~0.1µA,
for ATtinyX5 revisions that don't, ~20µA.

Build your own private, encrypted, open-source Dropbox-esque sync folder

Prerequisites:

  • One or more clients running a UNIX-like OS. Examples are given for Ubuntu 12.04 LTS, although all software components are available for other platforms as well (e.g. OS X). YMMV
  • A cheap Ubuntu 12.04 VPS with storage. I recommend Backupsy, they offer 250GB storage for $5/month. Ask Google for coupon codes.

Software components used:

  • Unison for file synchronization
  • EncFS for folder encryption
@aras-p
aras-p / preprocessor_fun.h
Last active November 15, 2024 09:22
Things to commit just before leaving your job
// Just before switching jobs:
// Add one of these.
// Preferably into the same commit where you do a large merge.
//
// This started as a tweet with a joke of "C++ pro-tip: #define private public",
// and then it quickly escalated into more and more evil suggestions.
// I've tried to capture interesting suggestions here.
//
// Contributors: @r2d2rigo, @joeldevahl, @msinilo, @_Humus_,
// @YuriyODonnell, @rygorous, @cmuratori, @mike_acton, @grumpygiant,
@patriciogonzalezvivo
patriciogonzalezvivo / GLSL-Noise.md
Last active November 18, 2024 07:45
GLSL Noise Algorithms

Please consider using http://lygia.xyz instead of copy/pasting this functions. It expand suport for voronoi, voronoise, fbm, noise, worley, noise, derivatives and much more, through simple file dependencies. Take a look to https://github.com/patriciogonzalezvivo/lygia/tree/main/generative

Generic 1,2,3 Noise

float rand(float n){return fract(sin(n) * 43758.5453123);}

float noise(float p){
	float fl = floor(p);
  float fc = fract(p);
@basham
basham / css-units-best-practices.md
Last active October 9, 2024 20:03
CSS Units Best Practices

CSS units

Recommendations of unit types per media type:

Media Recommended Occasional use Infrequent use Not recommended
Screen em, rem, % px ch, ex, vw, vh, vmin, vmax cm, mm, in, pt, pc
Print em, rem, % cm, mm, in, pt, pc ch, ex px, vw, vh, vmin, vmax

Relative units

Relative units

@seppo0010
seppo0010 / debate.md
Last active November 16, 2015 16:06
Transcripción resumida de "Argentina Debate 2015 | Segunda vuelta: el debate"

Debate completo: https://www.youtube.com/watch?v=susvCR2CF0M

Desarrollo Económico y Humano

Macri

Macri: Pobreza 0. Hace 4 años que no crece, hay que crear trabajo. Plan de infraestructura más importante de la historia, que conecte la argentina y desarrolle las economías regionales, generando 2.000.000 de puestos de trabajo. Créditos a 30 años para primera vivienda. Cloacas, agua corriente. La Asignación [Universal por Hijo] se extienda a todos, incluyendo hijos de monotributistas. Plan Primer Empleo, cinco primeros años sin impuestos para empleado ni empleador.

Scioli: Macri va a levantar el cepo, liberar el tipo de cambio, representa un recorte en el salario real. Abrir la economía es un peligro para el conjunto. ¿Quién va a pagar los costes de este ajuste?

@sgillies
sgillies / advanced_rasterio_features.ipynb
Last active October 19, 2024 17:20
Advanced Rasterio features notebook
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.