Skip to content

Instantly share code, notes, and snippets.

@felipec
felipec / steam.txt
Created June 3, 2014 10:34
Steam system information
Processor Information:
Vendor: GenuineIntel
CPU Family: 0x6
CPU Model: 0x3a
CPU Stepping: 0x9
CPU Type: 0x0
Speed: 2401 Mhz
4 logical processors
2 physical processors
HyperThreading: Supported
@felipec
felipec / enigma
Last active August 29, 2015 14:16
Enigma machine in Ruby
#!/usr/bin/env ruby
CHARS = ('A'..'Z')
=begin
def stringify(array)
array.map(&:join).join(' ')
end
@felipec
felipec / ingresos
Created August 24, 2015 19:05
Script para general ingresos correjidos del INEGI
#!/usr/bin/env ruby
$hogares = {}
open('concentradohogar.csv').each_with_index do |l,i|
next if i == 0
data = l.split(',')
viv, hog = data[0..1]
integ = data[13].tr('"', '').to_i
$hogares[[viv, hog]] = [integ, 0]
@felipec
felipec / fb_test.c
Created September 8, 2008 20:25
framebuffer test
#include <fcntl.h>
#include <sys/ioctl.h>
#include <linux/fb.h>
#include <sys/mman.h>
#include <stdio.h>
#include <stdint.h>
static struct fb_var_screeninfo sinfo;
static struct fb_fix_screeninfo fix_info;
@felipec
felipec / make_rootfs
Created September 17, 2008 23:26
rootfs helper
#!/bin/bash
## contents of ubinize.cfg
# [ubifs]
# mode=ubi
# image=/tmp/ubifs.img
# vol_id=0
# vol_size=128MiB
# vol_type=dynamic
# vol_name=rootfs
sb="/opt/scratchbox"
user="$USER"
sb_home="$sb/users/$user/home/$user"
sb_url="http://www.scratchbox.org/download/files/sbox-releases/apophis/tarball"
sb_base_dir=$(dirname $sb)
function setup_target()
{
#!/usr/bin/env ruby
$sucrose_points = 386.5
$extract_potential = {
'2 row' => 0.79,
'crystal 10L' => 0.75,
'carapils' => 0.72,
}
#!/bin/sh
RS=20
get_capacity()
{
c=`i2cget -y 2 0x55 0x0c w`
return $(($c * 3570 / $RS / 1000))
}
#!/usr/bin/env ruby
$TEST_PERIOD = 60 * 61
$SAMPLE_PERIOD = 60 * 10
$CAPACITY = 1320
$RS = 20
class Array
def mean
self.inject(0) { |sum, x| sum + x } / size.to_f
@felipec
felipec / gnome-survey.txt
Created August 5, 2011 18:23
GNOME user survey
GNOME user survey 2012
Welcome to the second GNOME user survey. This survey is not blessed by the GNOME team, it's built by users (and some developers as well).
This survey is anonymous, but all information that the users provide (raw data) will be publicly available to allow for independent analysis.
Note that you may skip questions as you like, but it should only take a few minutes to fill it completely.
In order to increase the validity of this survey, please ask people that normally wouldn't answer this survey to do so, also, if you know of somebody that doesn't have access, print it or make them available for them, and fill it online on their behalf. Also, if you know of somebody that couldn't possibly have access to this survey, please let us know, it's extremely important to know what kind of people can't be reached.