Skip to content

Instantly share code, notes, and snippets.

View ratacibernetica's full-sized avatar

Martín Roldán-Araujo ratacibernetica

View GitHub Profile
class CustomInput {
//constructor with default values
constructor({value = '', maxlength = 200, type = 'text', label = ''} = {}) {
this._value = value;
this.maxlength = maxlength;
this.type = type;
this.label = label;
}
get value() {
@ratacibernetica
ratacibernetica / bluetooth_healthy.js
Created June 22, 2018 04:44
web bluetooth API, detect Chinese smartwatch CK12s and Nokia Body+ D8 Scale Services and Characteristics
/* Tested with these devices
Smartwatch: https://www.aliexpress.com/item/JUNWER-Graphene-ECG-Smart-Band-CK12-Heart-Rate-Monitor-Blood-Pressure-Monitoring-Smart-Wriatband-IP67-Waterproof/32824701799.html
Nokia Scale: https://www.amazon.com/Nokia-Body-Composition-Wi-Fi-Scale/dp/B071XW4C5Q
*/
//list of GATT servicess (excluding incompatibles or not recognized)
const gattServices = [
'alert_notification',
'automation_io',
'battery_service',
@ratacibernetica
ratacibernetica / custom.com.conf
Last active July 8, 2018 19:55
NGINX conf for docker
# Strip www. from all requests (including subdomains)
# and force HTTPS
server {
listen 80 ;
listen [::]:80;
server_name www.custom.com;
# If the request has www prefix, strip it
if ($host ~* ^www\.(.*)) {
set $host_without_www $1;
@ratacibernetica
ratacibernetica / alexa-spanish-mx.xml
Created October 4, 2018 19:56
Alexa Mexico Speechcons
<speak>
<say-as interpret-as='interjection'>
aah.
a lo mejor.
a mano.
a todo dar.
abracadabra.
achís achís.
aguas.
ah.
@ratacibernetica
ratacibernetica / codeception.yml
Created October 29, 2018 14:26
codeception.yml with selenium
# suite config
suites:
acceptance:
actor: AcceptanceTester
path: .
modules:
enabled:
- WebDriver:
url: http://localhost:8080/
browser: chrome
@ratacibernetica
ratacibernetica / .htaccess
Created November 14, 2018 18:19
router script for PHPStorm http server and htaccess for public/index.php entry point
# public
RewriteEngine On
RewriteCond %{REQUEST_URI} !^/index.php$
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_URI} !\.(php|css|gif|ico|jpg|js|png|swf|txt|svg|woff|ttf|eot)$
RewriteRule (.*) index.php/$1 [QSA,L,E=PATH_INFO:/$1]
@ratacibernetica
ratacibernetica / install_firacode_font.bat
Last active November 19, 2018 18:37
FiraCode Font on Windows 10
choco install firacode
@ratacibernetica
ratacibernetica / composer.json
Created April 6, 2019 16:59
composer deploy to production
{
"name": "mroldan/php-mvc",
"description": "MVC micro framework demo",
"type": "project",
"require-dev": {
"friendsofphp/php-cs-fixer": "^2.13",
"phpmd/phpmd": "2.6.0",
"squizlabs/php_codesniffer": "3.3.2",
"codeception/codeception": "^2.5"
},
@ratacibernetica
ratacibernetica / queue.sh
Created April 9, 2019 00:02
laravel process queue in background
nohup php artisan queue:work --daemon > storage/logs/laravel.log &
@ratacibernetica
ratacibernetica / voices.sh
Last active April 23, 2019 16:03
voices macOS
#!/bin/bash
for i in $(say -v \? | awk '{print $1;}'); do echo $i; say -v $i "wubadubadubdub\!"; done