Skip to content

Instantly share code, notes, and snippets.

View osvaldoM's full-sized avatar
🎯
Focusing

Osvaldo Maria osvaldoM

🎯
Focusing
View GitHub Profile
@andreaselia
andreaselia / gist:aa2d44e3dde3b726d3affc4dec7d8b47
Created January 14, 2021 14:05
vue / nuxt reading time for blog posts/articles
<template>
<div>{{ readingTime }} min read</div>
</template>
<script>
export default {
props: ['content'],
computed: {
readingTime () {
let minutes = 0
@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: [],

PreloadableWorker

There's no way to <link rel=preload> a Web Worker. This fixes that.

npm i -S gist:developit/567dde2346d785b2628224fddbf6783c

<!-- workers are now just a normal script preload: -->
<link rel=preload href=/path/to/worker.js as=script crossorigin>
@sam016
sam016 / AllGattCharacteristics.java
Last active July 28, 2024 20:51
Bluetooth GATT Services & Characteristics
package com.sam016.vsflatomation.service.ble;
import java.util.HashMap;
import java.util.UUID;
public class AllGattCharacteristics {
private static HashMap<String, String> attributes = new HashMap();
static {
attributes.put("00002a00-0000-1000-8000-00805f9b34fb", "Device Name");
@AlanJenkinsVS
AlanJenkinsVS / App.vue
Created April 16, 2018 15:50
5. Transparent Wrappers - Vue JS Optimisations
<script>
export default {
inheritAttrs: false
}
</script>
<BaseInput placeholders="What's your name" @focus="doSomething" />
@marcelo-ribeiro
marcelo-ribeiro / javascript-remove-accents.js
Last active July 8, 2024 14:17 — forked from fabiofdsantos/angularJS_removeAccents.js
An Javascript function to remove accents and others characters from an input string.
// Example: https://codepen.io/marcelo-ribeiro/pen/OJmVOyW
const accentsMap = new Map([
["A", "Á|À|Ã|Â|Ä"],
["a", "á|à|ã|â|ä"],
["E", "É|È|Ê|Ë"],
["e", "é|è|ê|ë"],
["I", "Í|Ì|Î|Ï"],
["i", "í|ì|î|ï"],
["O", "Ó|Ò|Ô|Õ|Ö"],
@d1i1m1o1n
d1i1m1o1n / text
Created October 6, 2016 12:16
How to disable auto-save in phpstorm
How to disable auto-save:
Go to File > Settings (Ctrl+Alt+S).
Go to Appearance & Behavior > System Settings.
Make sure the two are unchecked:
Save files on frame deactivation
Save files automatically if application is idle for x sec.
Go to Editor > General > Editor Tabs
Put a checkmark on "Mark modified files with asterisk"
(Optional but recommended) Under "Tab Closing Policy", select "Close non-modified files first". You may also want to increase the number of allowed tabs.
Click Apply > OK.
@jvanja
jvanja / pngquant_on_all.sh
Created June 23, 2016 08:52
Execute pngquant on all PNGs in subfolders and overwrite original files.
pngquant -f --ext .png **/*.png
@anubhavshrimal
anubhavshrimal / CountryCodes.json
Last active July 29, 2024 13:13 — forked from Goles/CountryCodes.json
Country and Dial or Phone codes in JSON format
[
{
"name": "Afghanistan",
"dial_code": "+93",
"code": "AF"
},
{
"name": "Aland Islands",
"dial_code": "+358",
"code": "AX"
@kfriend
kfriend / respond_and_process.php
Created March 11, 2016 01:35
PHP: Send response and continue processing
<?php
// Buffer all upcoming output...
ob_start();
// Send your response.
echo "Testing response";
// Get the size of the output.
$size = ob_get_length();