Skip to content

Instantly share code, notes, and snippets.

View adriancmiranda's full-sized avatar
🌱
Today, what did you do for you tomorrow?

Adrian Miranda adriancmiranda

🌱
Today, what did you do for you tomorrow?
View GitHub Profile

Disable HTML Form Input Autocomplete and Autofill

  1. Add autocomplete="off" onto <form> element;
  2. Add hidden <input> with autocomplete="false" as a first children element of the form.
<form autocomplete="off" method="post" action="">
    <input autocomplete="false" name="hidden" type="text" style="display:none;">
    ...
@adriancmiranda
adriancmiranda / au.lua
Created October 31, 2022 15:26 — forked from numToStr/au.lua
Neovim autocmd in lua
--
-- Move this file to your neovim lua runtime path ie. ~/.config/nvim/lua/au.lua
--
local cmd = vim.api.nvim_command
local function autocmd(this, event, spec)
local is_table = type(spec) == 'table'
local pattern = is_table and spec[1] or '*'
local action = is_table and spec[2] or spec
if type(action) == 'function' then
@adriancmiranda
adriancmiranda / bash_strict_mode.md
Created October 1, 2022 18:39 — forked from mohanpedala/bash_strict_mode.md
set -e, -u, -o, -x pipefail explanation
export function doInputMask(value: string, pattern: string, placeholder?: string) {
const strippedValue = value.replace(/[^0-9]/g, '');
const chars = strippedValue.split('');
let count = 0;
let formatted = '';
for (let id = 0; id < pattern.length; id += 1) {
const item = pattern[id];
if (chars[count]) {
if (/\*/.test(item)) {
formatted += chars[count];
@adriancmiranda
adriancmiranda / rollup-typescript.md
Created May 20, 2022 15:09 — forked from aleclarson/rollup-typescript.md
The best Rollup config for TypeScript libraries

Features

🔥 Blazing fast builds
😇 CommonJS bundle
🌲 .mjs bundle
.d.ts bundle + type-checking
🧐 Source maps

Install

@adriancmiranda
adriancmiranda / create_source.rs
Created May 2, 2022 12:32 — forked from ctaggart/create_source.rs
Creating and Printing a TypeScript AST from Rust
#![allow(non_snake_case)]
#![allow(dead_code)]
// port of:
// Creating and Printing a TypeScript AST
// https://github.com/Microsoft/TypeScript/wiki/Using-the-Compiler-API#creating-and-printing-a-typescript-ast
extern crate typescript_ts as ts;
extern crate chakracore;
use chakracore::context::ContextGuard;
@adriancmiranda
adriancmiranda / index.js
Created January 26, 2022 01:39 — forked from sinterstice/index.js
"An Introduction to WebGL" tutorial code in vanilla JS
// From http://robots.thoughtbot.com/an-introduction-to-webgl
var app = function () {
var canvas = document.getElementById('canvas'),
gl = canvas.getContext('webgl') || canvas.getContext('experimental-webgl');
// Create elements on the page which contain your shaders.
// I like using script tags with a different type attribute, like:
// `<script id="vertex-shader" type="x-vertex/x-shader">`
// You could also just put the shaders inline, but I hate escaping line breaks.
var shaders = {
@adriancmiranda
adriancmiranda / commit-msg.js
Created August 10, 2021 11:14 — forked from bumbu/commit-msg.js
A script to prepend JIRA tag to the commit message based on branch name. Run from commit-msg git hook.
#!/usr/bin/env node
import * as fs from 'fs';
const JIRA_TAG = 'TAG';
/* If message title:
* * Doesn't start with square brackets []
* * Doesn't start with Merge branch
* * Doesn't start with Merge pull request
@adriancmiranda
adriancmiranda / tmux.conf
Created August 10, 2021 11:08 — forked from spicycode/tmux.conf
The best and greatest tmux.conf ever
# 0 is too far from ` ;)
set -g base-index 1
# Automatically set window title
set-window-option -g automatic-rename on
set-option -g set-titles on
#set -g default-terminal screen-256color
set -g status-keys vi
set -g history-limit 10000
#!/bin/bash
# run this scripts with `bash emoji-info.sh` or `./emoji-info.sh`
usage() {
cat << EOF
usage: $0 [options] <emoji>
Options:
-h Show this message
-o Octal Escape Sequence