Skip to content

Instantly share code, notes, and snippets.

@ricardoaguiar
ricardoaguiar / index.html
Created December 4, 2024 20:28 — forked from cferdinandi/index.html
Can you build a modern web app using only vanilla Web Components in 2024? Watch part 2 tutorial on YouTube: https://youtu.be/6pttzPPtiFA
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Pick at Random</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<style type="text/css">
body {
@ricardoaguiar
ricardoaguiar / index.html
Created October 19, 2024 10:49 — forked from Xatpy/index.html
CartoDB basemaps list
<!DOCTYPE html>
<html>
<head>
<title>Basemaps | CartoDB.js</title>
<meta name="viewport" content="initial-scale=1.0, user-scalable=no" />
<meta http-equiv="content-type" content="text/html; charset=UTF-8"/>
<link rel="shortcut icon" href="http://cartodb.com/assets/favicon.ico" />
<style>
html, body, .map {
height: 200px;
@ricardoaguiar
ricardoaguiar / dump.vim
Created July 25, 2024 16:32 — forked from mattn/dump.vim
google-calendar-holiday
scriptencoding utf-8
let s:calendar_list = [
\ ['Australian Holidays', 'en.australian#[email protected]'],
\ ['Austrian Holidays', 'en.austrian#[email protected]'],
\ ['Brazilian Holidays', 'en.brazilian#[email protected]'],
\ ['Canadian Holidays', 'en.canadian#[email protected]'],
\ ['China Holidays', 'en.china#[email protected]'],
\ ['Christian Holidays', 'en.christian#[email protected]'],
\ ['Danish Holidays', 'en.danish#[email protected]'],
@ricardoaguiar
ricardoaguiar / currency-symbols.xml
Created June 5, 2024 14:25 — forked from bzerangue/currency-symbols.xml
World currencies with their symbols
<?xml version="1.0" encoding="UTF-8"?>
<!--
## SOURCE: xe.com
-->
<currency-symbol count="115">
<entry code="ALL" unicode-decimal="76, 101, 107" unicode-hex="4c, 65, 6b">Albania Lek</entry>
<entry code="AFN" unicode-decimal="1547" unicode-hex="60b">Afghanistan Afghani</entry>
<entry code="ARS" unicode-decimal="36" unicode-hex="24">Argentina Peso</entry>
<entry code="AWG" unicode-decimal="402" unicode-hex="192">Aruba Guilder</entry>
<entry code="AUD" unicode-decimal="36" unicode-hex="24">Australia Dollar</entry>
@ricardoaguiar
ricardoaguiar / git-branches-by-commit-date.sh
Created January 25, 2024 09:27 — forked from jasonrudolph/git-branches-by-commit-date.sh
List remote Git branches and the last commit date for each branch. Sort by most recent commit date.
# Credit http://stackoverflow.com/a/2514279
for branch in `git branch -r | grep -v HEAD`;do echo -e `git show --format="%ci %cr" $branch | head -n 1` \\t$branch; done | sort -r
@ricardoaguiar
ricardoaguiar / getLocalIP.js
Created July 26, 2023 05:58 — forked from hectorguo/getLocalIP.js
Get local IP address through Javascript
/**
* Get Local IP Address
*
* @returns Promise Object
*
* getLocalIP().then((ipAddr) => {
* console.log(ipAddr); // 192.168.0.122
* });
*/
function getLocalIP() {
@ricardoaguiar
ricardoaguiar / .zshrc
Created July 20, 2023 10:05 — forked from dwchiang/.zshrc
gcloud with zsh
# The next line updates PATH for the Google Cloud SDK.
source /Users/dwchiang/google-cloud-sdk/path.zsh.inc
# The next line enables zsh completion for gcloud.
source /Users/dwchiang/google-cloud-sdk/completion.zsh.inc
@ricardoaguiar
ricardoaguiar / levenshtein.js
Created February 8, 2023 07:21 — forked from andrei-m/levenshtein.js
Levenshtein distance between two given strings implemented in JavaScript and usable as a Node.js module
/*
Copyright (c) 2011 Andrei Mackenzie
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
@ricardoaguiar
ricardoaguiar / _config.scss
Created December 2, 2022 15:01 — forked from michsch/_config.scss
Font size configuration with Sass (SCSS)
/* font size & line height in px */
$font-size-body-px: 14;
$line-height-px: 21;
/* calculate font-size (in %) and line-height (in em) */
$font-size-body: pc($font-size-body-px, 16);
$line-height: em($line-height-px, $font-size-body-px);
@ricardoaguiar
ricardoaguiar / multiple-git-clone.md
Created September 24, 2022 09:49 — forked from benizar/multiple-git-clone.md
Ubuntu post-installation script for cloning multiple git repositories.

multiple-git-clone.sh

Every time I install Ubuntu on a different computer, I need to clone again the same git repositories. This is why I use this bash script.

Usage

It clones the list of repositories to a convenient working directory in the home folder. I use the /home/git folder.

Arguments are lists of git repositories. One repo per line, one file per list. See the example: