Skip to content

Instantly share code, notes, and snippets.

View thewarpaint's full-sized avatar
🎄
https://dosmilveinte.mx

Eduardo Garcia thewarpaint

🎄
https://dosmilveinte.mx
View GitHub Profile
{
"mx": {
"statistics": {
"totalCases": 192208,
"deaths": 23273,
"fatalityRate": 12.11,
"recoveries": 135279
}
},
"us": {
@thewarpaint
thewarpaint / anagrams.rb
Last active April 11, 2020 22:17
Ruby crash course
def anagrams?(a, b)
frequencies_a = get_frequencies(a)
frequencies_b = get_frequencies(b)
if frequencies_a.length != frequencies_b.length
return false
end
frequencies_a.each do |key, value|
if value != frequencies_b[key]
@thewarpaint
thewarpaint / ecobici.geojson
Created February 22, 2020 06:11
Ecobici map
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@thewarpaint
thewarpaint / ecobici.js
Last active February 22, 2020 06:10
Ecobici
const url = 'https://www.ecobici.cdmx.gob.mx/availability_map/getJsonObject';
async function getData() {
const response = await fetch(url, { method: 'POST' });
const stations = await response.json();
return {
type: 'FeatureCollection',
features: stations.map(mapStation),
};
function compareNumber(a, b) {
return a - b;
}
function compareString(a, b) {
return a.localeCompare(b);
}
const comparatorMap = {
age: compareNumber,
@thewarpaint
thewarpaint / maskEmailAddress.js
Last active April 12, 2020 02:53
Mask an email address
function maskEmailAddress (emailAddress = '') {
const [
username = '',
domainName = ''
] = emailAddress.split('@')
return username.substring(0, 2) +
'***@' +
domainName
.split('.')
@thewarpaint
thewarpaint / .bash_profile
Last active September 11, 2019 14:43
Development env
if [ -f `brew --prefix`/etc/bash_completion.d/git-completion.bash ]; then
. `brew --prefix`/etc/bash_completion.d/git-completion.bash
fi
/* Pastel shades of: red, orange, yellow, green, blue and purple */
.rainbow-flag {
background: linear-gradient(180deg, #f28560, #f28560 16.67%,
#f2b560 16.67%, #f2b560 33.33%,
#f2cd60 33.33%, #f2cd60 50%,
#56d88c 50%, #56d88c 66.67%,
#60c1f2 66.67%, #60c1f2 83.33%,
#bd93d8 83.33%, #bd93d8);
}

Quotes

'‘’ > "“”

Fonts

  • Chango
  • Coustard
  • Erica One
  • Lily Script One
@thewarpaint
thewarpaint / index.html
Created February 6, 2018 13:12
Document upload
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
</head>
<body>
<h1>Document upload!!</h1>