Skip to content

Instantly share code, notes, and snippets.

View JJ's full-sized avatar
🏠
Working from home

Juan Julián Merelo Guervós JJ

🏠
Working from home
View GitHub Profile
@JJ
JJ / paras.pl
Created December 15, 2014 12:52
Write standard input or files as paragraphs in an HTML correct page
#!/usr/bin/env perl
use CGI qw(:standard);
use strict;
use warnings;
use v5.14; # Para say
my @parrafos = <>;
say start_html("Salida de párrafos");
for my $p (@parrafos) {
@JJ
JJ / top-github-users-granada.md
Created December 4, 2014 06:21
Top GitHub users, Dec 2014, Granada

Most active GitHub users (git.io/top)

The count of contributions (summary of Pull Requests, opened issues and commits) to public repos at GitHub.com from Wed, 04 Dec 2013 06:20:22 GMT till Thu, 04 Dec 2014 06:20:22 GMT.

Only first 1000 GitHub users according to the count of followers are taken. This is because of limitations of GitHub search. Sorting algo in pseudocode:

githubUsers
 .filter((user) -&gt; user.followers &gt; 1)
@JJ
JJ / github-user-stats-dec-2014.json
Created December 3, 2014 16:29
Top GitHub users Dec 2014 (filtered by number of followers and repos > 100)
[
{
"name": "♩ Ionică Bizău ♫ ♪",
"login": "IonicaBizau",
"location": "Romania",
"language": "JavaScript",
"gravatar": "https://avatars3.githubusercontent.com/u/2864371?v=3&s=400",
"followers": 150,
"organizations": [
"jillix",
@JJ
JJ / top-github-users-dec-2014.md
Last active March 5, 2021 01:25
Top GitHub users

Most active GitHub users

The count of contributions (summary of Pull Requests, opened issues and commits) to public repos at GitHub.com from Tue, 03 Dec 2013 07:25:57 GMT till Wed, 03 Dec 2014 07:25:57 GMT.

Only first 1000 GitHub users according to the count of followers and with more than a hundred repos are taken. This is because of limitations of GitHub search. Sorting algo in pseudocode:

githubUsers
 .filter((user) -&gt; user.followers &gt; 101 &amp; user.repos &gt; 101)
@JJ
JJ / resumen.gs
Created October 28, 2014 19:20
Google Spreadsheet: extrae información de una hoja y la copia en otra
/**
Esta función lee datos de una hoja de cálculo que contiene el nombre del proyecto y los dos URLs que buscamos: repo y web, en las columnas 1, 3 y 19 de la hoja de cálculo (respuestas a un formulario en Google Spreadsheet). Los escribe en tres columnas de otra hoja de cálculo, previo borrado de la misma
Funciona con Herramientas->Editor de secuencias de comandos. La primera vez que lo ejecutes sobre una hoja de cálculo tendrás que autorizarla. Aparte, hay que crear una segunda hoja de cálculo resumen y copiar el id para sustituir donde pone *unIdCualquiera*
El resultado de la ejecución está aquí: https://docs.google.com/spreadsheets/d/1RE2yPUs67D2AsQuo59Pj5ROSB3_4WTKqF0HmN3gupRw/edit?usp=sharing
*/
function summarize_projects() {
var sheet = SpreadsheetApp.getActiveSheet();
var output_sheet = SpreadsheetApp.openById("unIdCualquiera")
@JJ
JJ / pre-commit
Last active August 29, 2015 14:00 — forked from ilyakatz/pre-commit
#!/bin/bash -l
# A git hook script to find and fix trailing whitespace
# in your commits. Bypass it with the --no-verify option
# to git-commit
#
.git/hooks/pre-commit-master-no-no
if [[ $? == 1 ]]
then
@JJ
JJ / .bashrc
Last active August 29, 2015 13:59 — forked from justintv/.bashrc
# If you work with git, you've probably had that nagging sensation
# of not knowing what branch you are on, or worse, you pull the wrong branch.
# Worry no longer!
export PS1="\\w<\$(git branch 2>/dev/null | grep '^*' | colrm 1 2)>$ "
# This will change your prompt to display not only your working directory but also your current git branch, if you have one.
#~/txt/ocio/HashSlash<master>$ git checkout writer
#Switched to branch 'writer'
#~/txt/ocio/HashSlash<writer>$ git checkout master
@JJ
JJ / install_Git.pm.md
Last active January 6, 2017 11:32
Install Git.pm in a perlbrew installation

Git.pm is a module that comes with git and can't be installed with the usual cpan magic. If you switch to perlbrew you'll get a Can't locate Git.pm error when you try to run it, so you need to install it explicitly if you want to use it in your own installation, mainly if you use perlbrew I use it in my novels for post-commit hooks, so here's what you have to do to have it available in your programs

bash$ cp /usr/share/perl5/Git.pm ~/perl5/perlbrew/perls/perl-5.x.y/lib/site_perl/5.x.y

you'll have to change x.y by the perl version you're actually using. You'll also need Error.pm, so do

bash$ cp /usr/share/perl5/Error.pm ~/perl5/perlbrew/perls/perl-5.x.y/lib/site_perl/5.x.y

And that's it!

@JJ
JJ / wilcoxon-ga.chunk.pl
Last active August 29, 2015 13:57
Applying Wilcoxon-comparison based partial order to an evolutionary algorithm
for my $p ( @pop ) {
push(@{$p->{'_fitness_memory'}}, $noisy->apply( $p ));
$p->Fitness($comparisons);
}
for my $i (1..$comparisons) {
my @copy_of_population = @pop;
while( @copy_of_population ) {
my $first = splice( @copy_of_population, rand( @copy_of_population ), 1 );
my $second = splice( @copy_of_population, rand( @copy_of_population ), 1 );
my $aov = Statistics::ANOVA->new();
@JJ
JJ / chef-solo.sh
Created January 24, 2014 07:27
Provisioning chef-solo for ArchLinux 2013
pacman -S ruby make gcc
gem install chef ohai --no-user-install