Skip to content

Instantly share code, notes, and snippets.

View nandosola's full-sized avatar

Nando Sola nandosola

View GitHub Profile
@nandosola
nandosola / MLG-howto.md
Last active February 16, 2020 10:55
Málaga tips (from a local)

Moverse

A y desde el Centro

Alameda Principal y Plaza de la Merced son los puntos más céntricos accesibles por tte. público.

Metro

La Térmica está cerca de la estación de La Luz-La Paz. Para ir al centro, bájate en El Perchel (aka RENFE-María Zambrano) y camina hasta el centro (unos 20 min) o bien pilla el C2 o el 1 en la c/ Salitre y bájate en la parada de Pza. de La Merced.

Upgrade BIOS:
- dmesg | grep -i bios
- check latest version!!!
- https://thomashunter.name/blog/installing-linux-mint-on-an-xps13-9350/
Bluetooth always on and power management weirdness:
- http://manpages.ubuntu.com/manpages/zesty/man8/laptop-mode.conf.8.html
etc/laptop-mode/bluetooth.conf:
BATT_ENABLE_BLUETOOTH=0

Keybase proof

I hereby claim:

  • I am nandosola on github.
  • I am nando (https://keybase.io/nando) on keybase.
  • I have a public key whose fingerprint is 7448 A65E EEA9 9733 7286 E316 EC17 BED6 FE38 F057

To claim this, I am signing this object:

@nandosola
nandosola / assets.rake
Last active August 29, 2015 14:05
Manual asset pipeline for Sinatra
namespace :assets do
...
def get_relative_path(file_path, base_path)
(Set.new(file_path.split(File::SEPARATOR)) - Set.new(base_path.split(File::SEPARATOR))).
to_a.join(File::SEPARATOR)
end
...
desc 'compile assets'
@nandosola
nandosola / wrapped_integer.rb
Last active August 29, 2015 13:57
A proxy to wrap Integer so that specific behavior can be added to subclasses
# Numerics in Ruby are immediates, meaning that they don't represent
# a heap-allocated object. Since you can’t allocate them, you can’t
# create a subclass and allocate instances of the subclass.
# See: http://devblog.avdi.org/2011/08/17/you-cant-subclass-integers-in-ruby/
# This is a proxy object so that end users can "subclass" Integers.
# CAVEAT: Case equality with Integer will *never* be satisfied w/o monkeypatching Integer itself.
# Before using a WrappedInteger inside a 'case' clause, please coerce it to Integer using #to_i
class WrappedInteger < BasicObject
@nandosola
nandosola / gist:7942935
Created December 13, 2013 11:21
Just some advice to a friend of mine, ol' time Perl-monger
Following the "Scala way" (and learning the JVM/Java underpinnings as you go) will be fun!
First, you'll need a decent IDE:
* http://scala-ide.org/
Secondly, you'll have to wrap your head around Scala's functional nature. I know you've already got Perl background, so please read this first (or just skip it if you already know):
* http://hop.perl.plover.com/
* http://onionstand.blogspot.com.es/2013/07/scala-for-perl-5-programmers.html
@nandosola
nandosola / settings.xml
Created November 8, 2013 11:24
Our internal `settings.xml` - copy it to `~/.m2/`
<?xml version="1.0" encoding="UTF-8"?>
<settings xmlns="http://maven.apache.org/SETTINGS/1.1.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.1.0 http://maven.apache.org/xsd/settings-1.1.0.xsd">
<mirrors>
<mirror>
<id>rubygems</id>
<mirrorOf>rubygems</mirrorOf>
<!-- just for Ruby gems -->
<url>http://aedea.abstra:8081/nexus/content/repositories/rubygems-proxy</url>
</mirror>
@nandosola
nandosola / Gemfile
Last active December 24, 2015 00:29
Using scuby with jruby-scala-collections. Array#to_scala returns jruby.collection.ListWrapper, which basically extends Buffer. scala.collection.mutable.Buffer and List belong to the same category (Sequence), so they are equivalent.
source 'https://rubygems.org'
gem "jruby-scala-collections", "~> 0.1.4", require: "jruby/scala_support"
@nandosola
nandosola / daemon.rb
Last active December 17, 2015 04:59 — forked from ik5/daemon.rb
Daemonizing Puma in JRuby using the 'spoon' gem
#!/usr/bin/env jruby
require 'rubygems'
require 'spoon'
APPNAME = 'fileserver'
WORK_PATH = Dir.pwd
EXEC = "#{ENV['HOME']}/.rbenv/shims/puma"
PID_PATH = "#{WORK_PATH}/log/#{APPNAME}.pid"
OUT_PATH = "#{WORK_PATH}/log/#{APPNAME}.out.log"