Skip to content

Instantly share code, notes, and snippets.

View gmatheu's full-sized avatar
🤠
yeehaw!

Gonzalo Matheu gmatheu

🤠
yeehaw!
View GitHub Profile
@gmatheu
gmatheu / clean.js
Created December 5, 2019 15:45
Whizlabs exam Report cleaner
$('input[type=radio][checked=checked]').toArray().forEach(it => it.removeAttribute('checked'))
$('input[type=checkbox][checked=checked]').toArray().forEach(it => it.removeAttribute('checked'))
$('input[type=radio]').toArray().forEach(it => it.removeAttribute('disabled'))
$('label.correct-ans').toArray().forEach(it => it.classList.replace('correct-ans', 'hidden-ans'))
$('label.incorrect-ans').toArray().forEach(it => it.classList.remove('incorrect-ans'))
$('div.status').toArray().forEach(it => it.remove())
$('div.user-login-profile').toArray().forEach(it => it.remove())
$('div.reports').toArray().forEach(it => it.remove())
$('div.domains').toArray().forEach(it => it.remove())
@gmatheu
gmatheu / settings.xml
Last active April 16, 2019 20:29
AscentioTech's Bintray
<?xml version="1.0" encoding="UTF-8"?>
<settings xmlns="http://maven.apache.org/SETTINGS/1.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.0.0 http://maven.apache.org/xsd/settings-1.0.0.xsd">
<profiles>
<profile>
<id>sonatype-repository</id>
<activation>
<activeByDefault>true</activeByDefault>
</activation>
<pluginRepositories>
<pluginRepository>
@gmatheu
gmatheu / keybase.md
Created April 5, 2017 00:16
keybase.md

Keybase proof

I hereby claim:

  • I am gmatheu on github.
  • I am gmatheu (https://keybase.io/gmatheu) on keybase.
  • I have a public key whose fingerprint is 9007 BBDE 817F 6F06 E4B8 F30F 4E13 BCD4 5B5D F905

To claim this, I am signing this object:

@gmatheu
gmatheu / Dockerfile
Created January 14, 2016 01:59
frontend-runner
FROM ubuntu:latest
RUN apt-get update
RUN apt-get install -yy wget curl
RUN wget -q -O - https://dl-ssl.google.com/linux/linux_signing_key.pub | apt-key add -
RUN sh -c 'echo "deb http://dl.google.com/linux/chrome/deb/ stable main" > /etc/apt/sources.list.d/google.list'
RUN apt-get update
RUN apt-get install -yy xvfb firefox google-chrome-stable build-essential libssl-dev
RUN curl https://raw.githubusercontent.com/creationix/nvm/v0.16.1/install.sh | sh
@gmatheu
gmatheu / benchmark.sh
Last active March 1, 2017 00:57
benchmark
# https://wiki.mikejung.biz/Benchmarking#How_to_Break_In_an_SSD_before_Benchmarking
#--filename=$block_dev
echo "FIO randwrite"
fio --name=randwrite --ioengine=libaio --iodepth=1 --rw=randwrite --bs=4k --direct=0 --size=1024M \
--numjobs=8 --runtime=240 --group_reporting --output-format=json > fio-randwrite.json;
echo "FIO randread"
fio --name=randread --ioengine=libaio --iodepth=16 --rw=randread --bs=4k --direct=0 --size=1024M \
--numjobs=8 --runtime=240 --group_reporting --output-format=json > fio-randread.json;
@gmatheu
gmatheu / Test.java
Created October 9, 2015 19:07
Test Https Connection
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.net.URL;
import java.net.URLConnection;
import java.net.HttpURLConnection;
import java.util.logging.ConsoleHandler;
import java.util.logging.SimpleFormatter;
import java.util.logging.Logger;
@gmatheu
gmatheu / log-functions
Created October 5, 2015 22:20
shell-static-templates
info() {
echo "INFO: $1"
}
@gmatheu
gmatheu / .bashrc
Created April 21, 2015 12:19
Initialize SSH Agent
SSH_ENV="$HOME/.ssh/environment"
function start_agent {
echo "Initialising new SSH agent..."
/usr/bin/ssh-agent | sed 's/^echo/#echo/' > "${SSH_ENV}"
echo succeeded
chmod 600 "${SSH_ENV}"
. "${SSH_ENV}" > /dev/null
/usr/bin/ssh-add;
}
@gmatheu
gmatheu / gist:a293a2cfe0830c970ff8
Created January 23, 2015 20:46
Ajax Request Promise
var deferred = $.Deferred();
var ajax = $.ajax({url: '/config'}).
done(function(data) {
console.log('Data: ' + data);
deferred.resolve(data);
}).
fail(function (xhr, status) {
console.log("Fail: " + xhr.status);
deferred.fail();
});
@gmatheu
gmatheu / Dockerfile
Last active August 29, 2015 14:10
Tup Dockerfile
FROM ubuntu:14.04
MAINTAINER Gonzalo Matheu <gonzalommj@gmail.com>
RUN sed -i 's/# \(.*multiverse$\)/\1/g' /etc/apt/sources.list
RUN echo 'deb http://ppa.launchpad.net/anatol/tup/ubuntu precise main' >> /etc/apt/sources.list.d/tup.list
RUN sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 486D3664
RUN apt-get update
RUN sudo apt-get install -yy build-essential tup