This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function encodeBase64(str) { | |
return window.btoa(unescape(encodeURIComponent(str))); | |
} | |
function decodeBase64(str) { | |
return decodeURIComponent(escape(window.atob(str))); | |
} | |
// Usage: | |
encodeBase64('✓ à la mode'); // "4pyTIMOgIGxhIG1vZGU=" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
"use strict"; | |
const fs = require("fs"); | |
const path = require("path"); | |
const { google } = require("googleapis"); | |
const SCOPES = ["https://www.googleapis.com/auth/drive"]; | |
const KEYFILE_PATH = "config/credentials.json"; | |
const FOLDER_ID = "14DHCIe3CHdWSX_Z3PHPwsow-fVHE9ApG"; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
defaults write org.vim.ITerm ApplePressAndHoldEnabled -bool false | |
defaults write -g InitialKeyRepeat -int 10 # normal minimum is 15 (225 ms) | |
defaults write -g KeyRepeat -int 1 # normal minimum is 2 (30 ms) | |
# restart |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# https://medium.com/@devahmedshendy/traditional-setup-run-local-development-over-https-using-caddy-964884e75232 | |
# 1. sudo pacman -S mkcert | |
# 2. mkdir ./certs && cd ./certs | |
# 3. mkcert "*.sqila.local" | |
# 4. new line /etc/hosts/ -> 127.0.0.1 backend.sqila.local app.sqila.local | |
backend.sqila.local { | |
tls ./certs/_wildcard.sqila.local.pem ./certs/_wildcard.sqila.local-key.pem | |
reverse_proxy localhost:1337 { | |
header_up Host {host} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* Get started | |
* 1. create a folder and run `npm init` | |
* 2. run `npm install graphql-request slugify` | |
* 3. copy this file inside the folder | |
* 4. edit config (trello json, API_KEY, SOURCE_LIST, TARGET_PATH, etc...) | |
* 5. run `node index.js` | |
*/ | |
const { GraphQLClient } = require("graphql-request"); | |
const slugify = require("slugify"); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
set path+=** | |
set nocompatible " be iMproved, required | |
filetype off " required | |
let g:python_host_prog = '/usr/bin/python' | |
let g:python3_host_prog = '/usr/local/bin/python3.8' | |
" ----------------------------------------------------------------------------- | |
" | |
" Plugins list |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React, { useState } from "react"; | |
import ReactDOM from "react-dom"; | |
import useFuzzySearch from "./useFuzzySearch"; | |
const persons = [ | |
{ id: 1, name: "genesis" }, | |
{ id: 2, name: "jose" }, | |
{ id: 3, name: "mauro" }, | |
{ id: 4, name: "fredo" }, | |
{ id: 5, name: "meggie" }, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React, { useRef, useEffect } from 'react'; | |
/** | |
* Example: | |
* const [open, setOpen] = useState(false); | |
* ... | |
* <ClickOutside onBlur={() => setOpen(false)}> | |
* <MyDropdown open={open}/> | |
* </ClickOutsie> | |
*/ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import hoistStatics from 'hoist-non-react-statics'; | |
import React from 'react'; | |
/** | |
* Allows two animation frames to complete to allow other components to update | |
* and re-render before mounting and rendering an expensive `WrappedComponent`. | |
*/ | |
export default function deferComponentRender(WrappedComponent) { | |
class DeferredRenderWrapper extends React.Component { | |
constructor(props, context) { |
NewerOlder