Skip to content

Instantly share code, notes, and snippets.

@Jonarod
Jonarod / nano-base.css
Last active February 10, 2019 15:53
Minimalist CSS framework for Xtreme minimal devs :)
/* GLOBAL RESET */
@import url("https://gistcdn.githack.com/Jonarod/ab4e61a97aadd79db994c8dea3492a69/raw/49bac14b46470fd7933007fcdbedf219f173d087/reset.css");
/* TYPOGRAPHY */
@import url("https://gistcdn.githack.com/Jonarod/eed956dc8bd45fd90407de3eb740ec80/raw/a721babaa516b56e67bfb83b8d33c28a8f53120d/typography.css");
/* HELPERS */
@import url("https://gistcdn.githack.com/Jonarod/27e396f8b90498763e640ba9a6e27659/raw/c9a2cd4cc2ebdf8e1a17eed60de278639ca15454/helpers.css");
/* GRID */
@Jonarod
Jonarod / README.md
Last active April 20, 2024 19:27
Install Alpine Linux on Hetzner cloud
  1. Create an hetzner server using Ubuntu
  2. Go to the Hetzner's Server dashboard > Images
  3. Click on "Mount" over the alpine-linux-extended.iso image
  4. Shutdown the server
  5. Start the server
  6. Click the "Console" icon from the dashboard to open an interactive terminal session
  7. Login is root
  8. Configure the interface using the command setup-interfaces
  9. Pick to setup default eth0
  10. Custom config: no
@Jonarod
Jonarod / Service_Workers_Messaging.md
Last active January 3, 2024 19:16
Describes how to send messages between a page's main thread and a service worker thread

Page to ServiceWorker

// in page.html
navigator.serviceWorker.controller.postMessage({'hello':'world'});
// in sw.js
self.addEventListener('message', event => { 
@Jonarod
Jonarod / CheckBox.vue
Created November 23, 2019 18:20
Simple custom CheckBox component for Vue.js, compatible with v-model.
/**
* @usage:
*
* <CheckBox label="Foo" value="foo" v-model="MySelectedValues" />
* <CheckBox label="Bar" value="bar" v-model="MySelectedValues" />
* <CheckBox label="Baz" value="baz" v-model="MySelectedValues" />
*
* data(){
* return {
* MySelectedValues: [],
@Jonarod
Jonarod / RadioBox.vue
Created November 23, 2019 18:23
Simple custom Radio component for Vue.js, compatible with v-model.
/**
* @usage:
*
* <RadioBox label="Foo" value="foo" v-model="MySelectedValue" />
* <RadioBox label="Bar" value="bar" v-model="MySelectedValue" />
* <RadioBox label="Baz" value="baz" v-model="MySelectedValue" />
*
* data(){
* return {
* MySelectedValue: "",
@Jonarod
Jonarod / ToggleSwitch.vue
Created November 23, 2019 18:31
Simple custom Toggle Switch button for Vue.js, compatible with v-model.
/**
* @usage:
*
* <ToggleSwitch :trueFalseLabels="['On','Off']" :trueFalseColors="['#1CD4A7','#ccc']" v-model="isOn" />
*
* data() {
* return {
* isOn: false
* }
* }
@Jonarod
Jonarod / ubuntu commands.md
Last active April 1, 2020 17:27
Useful ubuntu commands

Automation

Execute a command at specific time

crontab -e

then, helped by crontab.guru, add a new line like:

@Jonarod
Jonarod / deepCopy.js
Created December 6, 2019 01:09
Fast & concise deep copy / deep clone / shallow copy in Javascript
var deepCopy = function (o) {
var t, x, key
t = Array.isArray(o) ? [] : {}
for (key in o) {
x = o[key]
t[key] = (typeof x === "object" && x !== null && !(x instanceof Date)) ? deepCopy(x) : x
}
return t
}
@Jonarod
Jonarod / blob_conversions_util.js
Created December 7, 2019 04:56
Javascript utility to convert Blob to Base64, ImageData or ObjectUrl back and forth. Tree shakeable and promise based.
const BlobToBase64 = function(blob){
let blobUrl = URL.createObjectURL(blob);
return new Promise((resolve, reject) => {
let img = new Image();
img.onload = () => resolve(img);
img.onerror = err => reject(err);
img.src = blobUrl;
}).then(img => {
URL.revokeObjectURL(blobUrl);
@Jonarod
Jonarod / README.md
Created August 21, 2020 13:11
Install Android Apps on Linux