Skip to content

Instantly share code, notes, and snippets.

View diniremix's full-sized avatar

Jorge Brunal diniremix

View GitHub Profile
@canalesb93
canalesb93 / settings.json
Created March 17, 2019 23:11
TODO VSCode Todo Tree Settings
// TO-DO Tree Extension
"todo-tree.expanded": true,
"todo-tree.tags": [
"TODO",
"FIXME",
"OPTIMIZE",
"STOPSHIP"
],
"todo-tree.customHighlight": {
"TODO": {
@p1ho
p1ho / Cache.js
Created February 25, 2019 07:20
Cache that implements expiration on top of flat-cache
'use strict'
const flatCache = require('flat-cache')
module.exports = class Cache {
constructor (name, path, cacheTime = 0) {
this.name = name
this.path = path
this.cache = flatCache.load(name, path)
this.expire = cacheTime === 0 ? false : cacheTime * 1000 * 60
PostgreSQL Type PostgreSQL Size Description Range Diesel Type Rust Type
Nullable Types nullable Nullable``
from itertools import islice
import firebase_admin
from firebase_admin import credentials
from firebase_admin import db
from firebase_admin import firestore
def _split(data, size=500):
"""Splits a dictionary into a sequence of smaller dictionaries."""
@vuejsdevelopers
vuejsdevelopers / app.js
Created October 31, 2017 13:26
Build A Lazy-Load Router With Vue.js And The Latest Browser Features - Snippet 05
import BooksPage from './pages/BooksPage.js';
new Vue({
el: '#app',
data: {
page: BooksPage
},
methods: {
navigate(event) {
this.page = () => import(`./${event.target.pathname}`)
// Vue.js < 2.5.0
@ankurk91
ankurk91 / 1-elementary-os-apps.md
Last active December 25, 2023 19:14
elementary OS 5.1 Hera

elementaryOS Apps and Configs

⚠️ No longer maintained! ⚠️

This guide has been updated for elementaryOS v5.0+.

Enbale PPA support

sudo apt-get update
sudo apt-get -y install software-properties-common
@NigelEarle
NigelEarle / Knex-Setup.md
Last active March 28, 2024 09:11
Setup Knex with Node.js

Knex Setup Guide

Create your project directory

Create and initialize your a directory for your Express application.

$ mkdir node-knex-demo
$ cd node-knex-demo
$ npm init
@benyanke
benyanke / fidget.sh
Last active November 5, 2017 07:13
Bash fidget spinner
# Bash Fidget Spinner
# Could also be included in a bashrc file
fidget() {
start_time="0.02";
spin_efficiency="0.99";
end_time="3";
time="$start_time";
printf "\e[92mPress any key to give another spin...\n\n";
@chrisveness
chrisveness / crypto-sha.js
Last active July 20, 2023 04:45
Uses the SubtleCrypto interface of the Web Cryptography API to hash a message using SHA-256.
/**
* Returns SHA-256 hash from supplied message.
*
* @param {String} message.
* @returns {String} hash as hex string.
*
* @example
* sha256('abc').then(hash => console.log(hash));
* const hash = await sha256('abc');
*/
@ivanleoncz
ivanleoncz / flask_app_logging.py
Last active May 23, 2021 07:25
Demonstration of logging feature for a Flask App.
#/usr/bin/python3
""" Demonstration of logging feature for a Flask App. """
from logging.handlers import RotatingFileHandler
from flask import Flask, request, jsonify
from time import strftime
__author__ = "@ivanleoncz"
import logging