Skip to content

Instantly share code, notes, and snippets.

@jvalduvieco
jvalduvieco / Hangman.test.ts
Last active September 4, 2021 07:05
Just a TDD kata wirting a hangman
import React from 'react';
type HangmanGameState = {
result: GameResult | null;
lastGuessStatus: GuessStatus | null;
doneGuesses: string[];
wordToGuess: string;
stage: GameStage;
maxTries: number;
@jvalduvieco
jvalduvieco / managing_laptop_power_usage.md
Created January 18, 2020 20:30
A quick guide to manage laptop power usage with udev and systemd

Managing laptop power usage

Create systemd targets and services

Create AC target (/etc/systemd/system/ac.target):

[Unit]
Description=On AC power
DefaultDependencies=no
StopWhenUnneeded=yes
@jvalduvieco
jvalduvieco / ssh-aws
Last active September 13, 2018 13:45
A little tool to ssh into AWS machines that lets you select profile, region and machine
#!/bin/bash
# ssh-aws [profile] [region] [machine_name]
if [ -z $1 ]; then
PROFILE=$(cat $HOME/.aws/credentials|grep -e "^\[" |sed -e 's/\[//; s/\]//'|percol)
else
PROFILE=$1
fi
if [ -z $2 ]; then
REGION=$(echo "US West (Oregon) Region us-west-2
@jvalduvieco
jvalduvieco / gist:d9f004e07d2e83966fa5
Created February 1, 2015 19:23
Convert UUID From bin to text and reverse
DELIMITER |
CREATE FUNCTION UuidFromBin(b BINARY(16))
RETURNS CHAR(36) DETERMINISTIC
BEGIN
DECLARE hex CHAR(32);
SET hex = HEX(b);
RETURN LCASE(CONCAT_WS('-',SUBSTR(hex,1, 8), SUBSTR(hex, 9,4), SUBSTR(hex, 13,4), SUBSTR(hex, 17,4), SUBSTR(hex, 21, 12)));
END
|
@jvalduvieco
jvalduvieco / gist:e9e0b803dc4c77e7116c
Last active August 29, 2015 14:07
sys_adm_offer_1409

#System Administrator Location: Barcelona, Spain

Number of vacancies: one

Salary: Paid depending on experience. (25k - 38k)

##Description We are looking for a system administrator that can manage our infrastructure in the AWS cloud. She/He must be an expert on GNU/Linux system internals, automation, networking, software deployment and security. At Akamon engineering you are part of a big team that is responsible to create our company products. So you will be working with game and backend developers, analytics and marketing people being a key role in our company operations and giving you a 360 degree view of our bussiness.

@jvalduvieco
jvalduvieco / sw_eng_offer_1407.md
Last active August 29, 2015 14:03
Akamon PHP software engineer

#PHP Software Engineer Location: Barcelona, Spain

Number of vacancies: a few

Salary: Paid depending on experience, team decides. (25k - 42k)

##Description Our software engineers are responsible for designing and delivering the high quality systems that drive Akamon server platform. Right now we are searching a software engineer specialist in PHP. We love t-shirt engineers, who know about wide range of technologies/fields but are expert on a few. We have a collaborative, fast-paced environment where knowledge sharing and collaboration is a must.

Keybase proof

I hereby claim:

  • I am jvalduvieco on github.
  • I am jvalduvieco (https://keybase.io/jvalduvieco) on keybase.
  • I have a public key whose fingerprint is 67EE 8728 BB6B 23CD 696D 591D CEB0 1863 B504 299E

To claim this, I am signing this object:

Process: beam.smp [96877]
Path: /usr/local/Cellar/erlang/R16B/lib/erlang/erts-5.10.1/bin/beam.smp
Identifier: beam.smp
Version: 0
Code Type: X86-64 (Native)
Parent Process: bash [10116]
User ID: 501
Date/Time: 2013-03-17 22:55:38.148 +0100
OS Version: Mac OS X 10.8.3 (12D78)
@jvalduvieco
jvalduvieco / wxgtk.rb
Created December 25, 2012 23:58
wxgtk Homebrew formula
require 'formula'
class Wxgtk < Formula
homepage 'http://www.wxwidgets.org'
#url 'http://sourceforge.net/projects/wxwindows/files/2.8.12/wxWidgets-2.8.12.tar.bz2'
#version '2.8.12'
url "http://downloads.sourceforge.net/project/wxwindows/2.8.12/wxGTK-2.8.12.tar.gz"
sha1 '56cc7f6622dd6f2fecd43fc210dc1c6cb155b37f'
depends_on :x11 # if your formula requires any X11/XQuartz components
@jvalduvieco
jvalduvieco / erlang.rb
Created December 25, 2012 23:56
Erlang Homebrew formula with wxgtk support.
require 'formula'
class ErlangManuals < Formula
url 'http://erlang.org/download/otp_doc_man_R15B03-1.tar.gz'
sha1 'c8674767cd0c1f98946f6a08c7ae318c3f026988'
end
class ErlangHtmls < Formula
url 'http://erlang.org/download/otp_doc_html_R15B03-1.tar.gz'
sha1 '49d761d8554a83be00e18f681b32b94572f9c050'