This focuses on generating the certificates for loading local virtual hosts hosted on your computer, for development only.
Do not use self-signed certificates in production ! For online certificates, use Let's Encrypt instead (tutorial).
function makeSlug(value: string, separator?: string = '_'): string { | |
const mapAccentsHex: any = { | |
a : /[\xE0-\xE6]/g, | |
A : /[\xC0-\xC6]/g, | |
e : /[\xE8-\xEB]/g, | |
E : /[\xC8-\xCB]/g, | |
i : /[\xEC-\xEF]/g, | |
I : /[\xCC-\xCF]/g, | |
o : /[\xF2-\xF6]/g, | |
O : /[\xD2-\xD6]/g, |
//add this to your package.json | |
// "audio-buffer-utils": "^5.1.2", | |
// "audio-decode": "^1.4.0", | |
// "audiobuffer-to-wav": "^1.0.0", | |
// "node-lame": "^1.2.0", | |
// "ogg.js": "^0.1.0", | |
// "opus.js": "^0.1.1", | |
const fs = require('fs'); |
<?php | |
// UPDATE! Checkout this plugin https://github.com/valu-digital/wp-graphql-cache | |
// Requires some persistent object cache such as wp-redis. | |
define( 'WP_GRAPHQL_CACHE_AGE', 10 ); // in seconds | |
add_action( 'do_graphql_request', function () { |
This focuses on generating the certificates for loading local virtual hosts hosted on your computer, for development only.
Do not use self-signed certificates in production ! For online certificates, use Let's Encrypt instead (tutorial).
There are so many great GIFs out there and I want to have copies of them. Twitter makes that harder than it should be by converting them to MP4 and not providing access to the source material. To make it easier, I made a bash pipeline that takes a tweet URL and a filename, extracts the MP4 from that tweet and uses ffmpeg to convert back to GIF.
brew install ffmpeg
apt install ffmpeg
# Tested on Python 3.6.1 | |
# install: pip install --upgrade arabic-reshaper | |
import arabic_reshaper | |
# install: pip install python-bidi | |
from bidi.algorithm import get_display | |
# install: pip install Pillow | |
from PIL import ImageFont |
#!/usr/bin/perl | |
use strict; | |
my $http_base = shift; | |
my $path_base = shift; | |
my $prev_file = shift; | |
if ( ! $http_base || ! $path_base ) { | |
print STDERR <<"HERE"; | |
USAGE: |
// The Vue build version to load with the `import` command | |
// (runtime-only or standalone) has been set in webpack.base.conf with an alias. | |
import Vue from 'vue' | |
import App from './App' | |
import VeeValidator, { Validator } from 'vee-validate' | |
import CpfValidator from './components/validators/cpf.validator' | |
import Dictionary from './components/validators/dictionary' | |
import Produto from './components/produtos.vue' | |
Validator.extend('cpf', CpfValidator) |
// The following data should be run in the console while viewing the page https://read.amazon.com/ | |
// It will export a CSV file called "download" which can (and should) be renamed with a .csv extension | |
var db = openDatabase('K4W', '3', 'thedatabase', 1024 * 1024); | |
getAmazonCsv = function() { | |
// Set header for CSV export line - change this if you change the fields used | |
var csvData = "ASIN,Title,Authors,PurchaseDate\n"; | |
db.transaction(function(tx) { |
var gulp = require('gulp'); | |
var runSequence = require('run-sequence'); | |
var minifyCss = require('gulp-minify-css'); | |
var buildDir = './build/'; | |
var build = new Date().getTime(); | |
var minifyCssSettings = { advanced: true, aggressiveMerging: true }; | |
// Main build |