Skip to content

Instantly share code, notes, and snippets.

View mvaello's full-sized avatar
✈️
Working @ AIRBUS

Miguel Vaello mvaello

✈️
Working @ AIRBUS
  • Spain
View GitHub Profile
@n1ru4l
n1ru4l / index.js
Created August 7, 2017 10:47
Fetch blob and convert to base64
export const fetchAsBlob = url => fetch(url)
.then(response => response.blob());
export const convertBlobToBase64 = blob => new Promise((resolve, reject) => {
const reader = new FileReader;
reader.onerror = reject;
reader.onload = () => {
resolve(reader.result);
};
reader.readAsDataURL(blob);
@max-mapper
max-mapper / bibtex.png
Last active March 10, 2024 21:53
How to make a scientific looking PDF from markdown (with bibliography)
bibtex.png
@sebastianhaas
sebastianhaas / user.json
Created October 1, 2015 21:10
LoopBack User Friendship
{
"name": "user",
"plural": "users",
"base": "User",
"idInjection": true,
"options": {
"validateUpsert": true
},
"properties": {},
"validations": [],
@k33g
k33g / index.html
Last active April 18, 2019 05:49
Vue.js + ES6
<div id="demo">
<h1>{{bob.fields.firstName}} {{bob.fields.lastName}}</h1>
</div>
<ul id="humans-list">
<li v-repeat="humans">
{{fields.firstName}} {{fields.lastName}}
</li>
</ul>
@ronivaldo
ronivaldo / rpmLargeFont.ino
Created May 15, 2013 21:02
A set of custom made large numbers for a 16x2 LCD HD44780 Arduino Library
/*
A set of custom made large numbers for a 16x2 LCD using the
LiquidCrystal librabry. Works with displays compatible with the
Hitachi HD44780 driver.
The Cuicuit:
LCD RS pin to D12
LCD Enable pin to D11
LCD D4 pin to D5
LCD D5 pin to D4
@jednano
jednano / gitcom.md
Last active May 31, 2023 08:23
Common git commands in a day-to-day workflow

Git Cheat Sheet

Initial Setup

Create an empty git repo or reinitialize an existing one

git init
@mattattui
mattattui / index.html
Last active November 17, 2023 13:55
Count online users
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-type" content="text/html; charset=utf-8">
<title>Pinger test</title>
<script src="https://code.jquery.com/jquery-3.6.0.min.js" type="text/javascript" charset="utf-8"></script>
</head>
<body>
@mvaello
mvaello / gist:2949345
Created June 18, 2012 16:45 — forked from zenitraM/gist:2949330
Simple template engine
/* Templates to load: */
function Template(templateUrl) {
this.template = false;
this.compiledTemplate= false;
this.templateUrl = templateUrl;
this.draw = function(contents) {
//We compile the template if it isn't compiled yet.
this.compiledTemplate = this.compiledTemplate || Handlebars.compile(this.template);
return this.compiledTemplate(contents);
@maxidr
maxidr / Spanish.inflectors.txt
Created February 22, 2011 03:51
Spanish inflectors for rails 3
ActiveSupport::Inflector.inflections do |inflect|
inflect.plural /([aeiou])([A-Z]|_|$)/, '\1s\2'
inflect.plural /([rlnd])([A-Z]|_|$)/, '\1es\2'
inflect.plural /([aeiou])([A-Z]|_|$)([a-z]+)([rlnd])($)/, '\1s\2\3\4es\5'
inflect.plural /([rlnd])([A-Z]|_|$)([a-z]+)([aeiou])($)/, '\1es\2\3\4s\5'
inflect.singular /([aeiou])s([A-Z]|_|$)/, '\1\2'
inflect.singular /([rlnd])es([A-Z]|_|$)/, '\1\2'
inflect.singular /([aeiou])s([A-Z]|_)([a-z]+)([rlnd])es($)/, '\1\2\3\4\5'
inflect.singular /([rlnd])es([A-Z]|_)([a-z]+)([aeiou])s($)/, '\1\2\3\4\5'
@scottferg
scottferg / LinuxMultitouch.py
Created August 24, 2010 02:13
Hard coded multitouch desktop gestures for Ubuntu/GNOME. To use it, enable the Dbus/Scale/Rotate plugins in Compiz.
from pymt import *
import sys, dbus, subprocess, os
import time
class Tracer(MTWidget):
SWIPE_X_THRESHOLD = 220
SWIPE_Y_THRESHOLD = 100
LEFT_SWIPE, RIGHT_SWIPE = range(2)
block = False