Skip to content

Instantly share code, notes, and snippets.

Javier Aranda javierav

Block or report user

Report or block javierav

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
@javierav
javierav / useful-npm-packages.md
Last active Aug 29, 2015
collection of useful NPM packages
View useful-npm-packages.md

Useful NPM packages

Tools

  • utils-merge: Merges the properties from a source object into a destination object.
  • wildcard: Apply a wildcard search in string, arrays or objects.
View run-tests.sh
#!/usr/bin/env bash
bundle exec rspec
set +e
# integration
if [ -e rerun.txt ]; then
rm -f rerun.txt
fi
@javierav
javierav / Gemfile
Created Sep 13, 2014
compare two directories using a sha-256 hash digest
View Gemfile
source 'https://rubygems.org'
gem 'sequel'
gem 'sqlite3'
View self-signed-ssl-certs.md

Create a root CA certificate

To begin with, you need to generate the root CA key (this is what signs all issued certs):

openssl genrsa -out rootCA.key 2048

Generate the self-signed (with the key previously generated) root CA certificate:

View vim-tips.md

Vim Tips

search and replace

:%s/search/replace/g

reset search results

:noh

remove endline blank spaces

:%s/\s\+$/

View bash-tips.md

Bash Tips

text replace in some files

grep -rl "windows" . | xargs sed -i "s/windows/linux/g"

@javierav
javierav / invisible.rb
Created Dec 2, 2014
Ruby Secret Santa
View invisible.rb
# Ruby Secret Santa
# Javier Aranda <jaranda@nosolosoftware.es>
# MIT license
# friends list
@friends = [
{ name: 'Jesús Taguas', alias: 'jtaguas' },
{ name: 'Rafa García', alias: 'rgarcia' },
{ name: 'Jesús González', alias: 'jgonzalez' },
{ name: 'Paco Hidalgo', alias: 'fhidalgo' },
@javierav
javierav / calc.rb
Last active Aug 29, 2015
Calculadora Curso de Git
View calc.rb
class Calc
def initialize(a, b)
@a = a
@b = b
end
end
@javierav
javierav / removedir.php
Created Apr 7, 2012
Script PHP para borrar de forma recursiva un directorio
View removedir.php
<?php
/*
* this function removes a directory and its contents.
* use with careful, no undo!
*/
function rmdir_recursive($dir) {
$files = scandir($dir);
array_shift($files); // remove '.' from array
array_shift($files); // remove '..' from array
@javierav
javierav / Assetfile.rb
Created Jan 6, 2013
Development with Rake Pipeline and Guard
View Assetfile.rb
# vim: filetype=ruby
require 'rake-pipeline-web-filters'
require 'rake-pipeline-i18n-filters'
class Minispade < Rake::Pipeline::Web::Filters::MinispadeFilter
def initialize(options = {})
super
@sourceURL = options[:source_url]
end
You can’t perform that action at this time.