Skip to content

Instantly share code, notes, and snippets.

View PierBover's full-sized avatar

Pier Bover PierBover

View GitHub Profile
@jaames
jaames / astro.config.mjs
Created January 3, 2022 15:14
Injecting global SCSS variables in Astro (https://astro.build), using additionalData and a path alias
import { fileURLToPath } from 'url';
import path, { dirname } from 'path';
const __filename = fileURLToPath(import.meta.url);
const __dirname = dirname(__filename);
export default {
// all the usual config goes here...
@agentphantom
agentphantom / mx_complete.csv
Last active December 31, 2021 22:06
Casos Confirmados, Defunciones, Ambulatorios, Hospitalizados e Intubados por Municipio
entidad municipio confirmados defunciones activos ambulatorios ambulatorios_fallecidos hospitalizados hospitalizados_fallecidos intubados intubados_fallecidos
Aguascalientes Aguascalientes 32906 2613 722 27150 181 5756 2432 716 569
Aguascalientes Asientos 606 48 4 478 6 128 42 20 10
Aguascalientes Calvillo 1252 34 7 1107 2 145 32 18 13
Aguascalientes Cosío 149 14 0 108 0 41 14 10 7
Aguascalientes El Llano 129 22 2 85 0 44 22 14 12
Aguascalientes Jesús María 1236 86 48 1011 12 225 74 38 24
Aguascalientes No Especificado 2 0 0 2 0 0 0 0 0
Aguascalientes Pabellón de Arteaga 1081 76 6 905 5 176 71 37 29
Aguascalientes Rincón de Romos 1003 74 4 771 3 232 71 39 28
@ptpaterson
ptpaterson / nested-fql-manual.js
Last active December 26, 2021 15:09
Template for building deeply nested FQL queries for FaunaDB
const baseQuery = q.Paginate(q.Match(q.Index(indexName), terms));
// or
// const baseQuery = q.Paginate(q.Collection(collectionName))
const expandedQuery = q.Map(baseQuery, (ref) =>
q.Let(
{
instance: q.Get(q.Var('ref'))
},
{
@coltenkrauter
coltenkrauter / html-input-remove-chrome-autofill-background.css
Last active February 6, 2024 19:38
Remove Chrome's autofill background color on HTML inputs. This unique solution makes the background color to transparent rather then a solid color.
// Remove chrome autofill color from inputs
input:-webkit-autofill,
input:-webkit-autofill:hover,
input:-webkit-autofill:focus,
input:-webkit-autofill:active {
transition: background-color 5000000s ease-in-out 0s;
}
# Credit: https://stackoverflow.com/questions/2781549/removing-input-background-colour-for-chrome-autocomplete#answer-29350537
@mholt
mholt / macapp.go
Last active April 8, 2024 17:54
Distribute your Go program (or any single binary) as a native macOS application
// Package main is a sample macOS-app-bundling program to demonstrate how to
// automate the process described in this tutorial:
//
// https://medium.com/@mattholt/packaging-a-go-application-for-macos-f7084b00f6b5
//
// Bundling the .app is the first thing it does, and creating the DMG is the
// second. Making the DMG is optional, and is only done if you provide
// the template DMG file, which you have to create beforehand.
//
// Example use:
@J2TEAM
J2TEAM / sublime-text-scopes.md
Last active January 17, 2024 22:44 — forked from iambibhas/scopes.txt
Sublime Text 2/3: Snippet scopes

Here is a list of scopes to use in Sublime Text 2/3 snippets -

ActionScript: source.actionscript.2
AppleScript: source.applescript
ASP: source.asp
Batch FIle: source.dosbatch
C#: source.cs
C++: source.c++
Clojure: source.clojure
@lucdew
lucdew / json_postgres.js
Last active November 16, 2022 17:49
Example of json document storage in postgresql and querying (with knex.js)
var connectionString = 'postgres://localhost:5432/postgres';
var Promise=require('bluebird');
var knex = require('knex')({
client: 'pg',
connection: {
user: 'postgres',
database: 'postgres',
port: 5432,
@jordangarcia
jordangarcia / jsbin.kubosudi.css
Created June 5, 2014 22:04
Example of drag and drop using Hammer.js
.box {
padding: 5px;
background: red;
margin: 10px;
position:relative;
z-index: 3;
}
.drag-target {
background: blue;
z-index: 1;
@unverbraucht
unverbraucht / gist:118117ab66ac142f4eda
Last active January 24, 2023 18:16
Script for OpenWRT that adds delay, bandwidth limiting and packet loss to a Wi-Fi router connection. See http://kevin-read.com/post/86601925386/simulating-a-slow-network-connection-when-testing-on for details
#!/bin/sh
# The bandwidth to simulate, here about 56kilobit per second. This is layer 2 bandwidth, so TCP/UDP and IP overhead will apply
BW="56kbps"
# _Half_ the latency that we aim for. Since this applies to both the WAN port and Wi-Fi, the delay is applied twice, so this actually puts it at around 120+ms
LATENCY="60ms"
# Chance of packet loss. Also applied to both interfaces, so it is 1%.
LOSS="0.5%"
# The device name of your wifi device.
WIFI="wlan0"
@uhop
uhop / nginx-webp-sample.conf
Last active November 3, 2023 12:09
Serving WEBP with nginx conditionally.
user www-data;
http {
##
# Basic Settings
##
sendfile on;
tcp_nopush on;