Skip to content

Instantly share code, notes, and snippets.

Felipe Contreras felipec

Block or report user

Report or block felipec

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@felipec
felipec / grhg-walk-test
Created Jun 20, 2019
Script to test different git-remote-hg revision walking algorithms
View grhg-walk-test
#!/usr/bin/env python2
from mercurial import hg, ui, dagop, smartset
import sys, time
class Marks:
def __init__(self):
self.marks = None
@felipec
felipec / scanl.rb
Created Jan 12, 2018
Simple scanl implementation
View scanl.rb
class Array
def scanl(init)
self.reduce([init]) { |a, e| a.push(yield(a.last, e)) }
end
end
accum = [5, 10, 15].scanl(0) { |a, b| a + b }[1..-1]
View installkernel
#!/bin/bash
v=$1
o=$2
d=$4
loaders=('grub')
test -r /etc/default/installkernel &&
source /etc/default/installkernel
View openssl-1.0-versioned-symbols.patch
Configure | 2 +
engines/ccgost/openssl.ld | 10 +
engines/openssl.ld | 10 +
openssl.ld | 4620 +++++++++++++++++++++++++++++++++++++++++++++
4 files changed, 4642 insertions(+)
--- a/Configure
+++ b/Configure
@@ -1681,6 +1681,8 @@ if ($strict_warnings)
}
@felipec
felipec / aur-check
Last active Jan 18, 2018
Script to check AUR packages
View aur-check
#!/usr/bin/env ruby
# This script checks all your foreign packages against AUR to find newer versions
require 'net/http'
require 'json'
require 'cgi'
$packages = {}
$verbose = false
View brew
#!/usr/bin/env ruby
$sucrose_points = 386.5
$extract_potential = {
'2 row' => 0.79,
'crystal 10L' => 0.75,
'carapils' => 0.72,
}
@felipec
felipec / ingresos
Created Aug 24, 2015
Script para general ingresos correjidos del INEGI
View ingresos
#!/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 / enigma
Last active Aug 29, 2015
Enigma machine in Ruby
View enigma
#!/usr/bin/env ruby
CHARS = ('A'..'Z')
=begin
def stringify(array)
array.map(&:join).join(' ')
end
@felipec
felipec / steam.txt
Created Jun 3, 2014
Steam system information
View steam.txt
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 / git-marks-check
Last active Sep 8, 2016
Tool to check and fix git-remote-hg marks
View git-marks-check
#!/usr/bin/env ruby
require 'json'
$fix = false
$verbose = false
$git_marks = {}
$r_marks = {}
$note_marks = {}
$mode = 'hg'
You can’t perform that action at this time.