I hereby claim:
- I am jordinebot on github.
- I am jordinebot (https://keybase.io/jordinebot) on keybase.
- I have a public key ASC3vgRoWagImYv9afncwCePx4SkcAnbzU-miwtNcQaZfgo
To claim this, I am signing this object:
/* | |
* Given an integer n, count the total number of 1 digits appearing in all non-negative integers less than or equal to n. | |
* | |
* > numberOfOnes(14) | |
* > 7 // 1, 10, 11, 12, 13, 14 | |
* | |
*/ | |
function numberOfOnes(n) { | |
return [...Array(n + 1).keys()].reduce( |
/* https://developer.mozilla.org/en-US/docs/Web/API/XMLHttpRequest/readyState */ | |
const UNSENT = 0, | |
OPENED = 1, | |
HEADERS_RECEIVED = 2, | |
LOADING = 3, | |
DONE = 4; | |
/* https://developer.mozilla.org/en-US/docs/Web/HTTP/Status */ | |
const OK = 200; |
#!/bin/bash | |
# Set fan 1 to forced mode | |
smc -k "FS! " -w 0002 | |
# Set fan 1 to required RPM (Use rpm2hex to get the value) | |
RPM="$(rpm2hex $1)" | |
smc -k F1Tg -w ${RPM:2:4} | |
echo "Fan 1 set to $RPM RPM" |
I hereby claim:
To claim this, I am signing this object:
let jordiNebot = { | |
type: 'Full Stack Web Developer', | |
employer: 'Self-employed', | |
from: { | |
city: 'Barcelona', | |
coordinates: { | |
lat: 41.3891006, | |
lng: 2.1333274999999503 | |
} | |
}, |
# ######################## | |
# Leverage browser caching | |
# ######################## | |
<IfModule mod_expires.c> | |
ExpiresActive On | |
ExpiresByType image/gif A2592000 | |
ExpiresByType image/jpeg A2592000 | |
ExpiresByType image/jpg A2592000 | |
ExpiresByType image/png A2592000 |
class API | |
constructor: (url) -> | |
@url ?= apiURL | |
@status = | |
OK: 200, | |
DONE: 4 | |
@cache = {} | |
@cacheExpiration = 0 #seconds |
patterns = | |
name: | |
/// ^ | |
[a-z|A-Z|àáèéíòóúÀÁÈÉÍÒÓÚïÏüÜçÇñÑ\-ºª\s]{2,} | |
$ ///i | |
email: | |
/// ^ | |
([\w-\.]+@([\w-]+\.)+[\w-]{2,4}) | |
$ ///i | |
date: |
/* Load Wordpress in any file inside wp-content/ */ | |
defined('ABSPATH') or define('ABSPATH', preg_replace('/\/wp-content\/.*/', '', __DIR__) . '/'); | |
require_once ABSPATH . 'wp-load.php'; |
/* Clearfix */ | |
@mixin clearfix { | |
&:after { | |
content: ""; | |
display: table; | |
clear: both; | |
} | |
} | |
/* Media Queries */ |