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
@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 / 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 / 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 / bash_strict_mode.md
Created October 1, 2022 18:39 — forked from mohanpedala/bash_strict_mode.md
set -e, -u, -o, -x pipefail explanation
@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

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 / .gitlab-ci.yml
Created December 16, 2022 23:10 — forked from superjose/.gitlab-ci.yml
This is an example of a .gitlab-ci.yml that is required for Continuous Integration on GitLab projects.
# Reference: https://www.exclamationlabs.com/blog/continuous-deployment-to-npm-using-gitlab-ci/
# GitLab uses docker in the background, so we need to specify the
# image versions. This is useful because we're freely to use
# multiple node versions to work with it. They come from the docker
# repo.
# Uses NodeJS V 9.4.0
image: node:9.4.0
# And to cache them as well.
@adriancmiranda
adriancmiranda / vitals.js
Created January 27, 2023 18:25 — forked from daliborgogic/vitals.js
[POC] Sending Vite.js Core Web Vitals to Google Analytics
const transformer = options => ({
apply: 'post',
transform({ code, isBuild }) {
if (!isBuild) return code
return code.replace('</body>', `<script defer type="module">
const KEY = 'ga:user'
const UID = (localStorage[KEY] = localStorage[KEY] || Math.random() + '.' + Math.random())
const onError = err => console.error('[vite vitals] ', err)
const onDebug = (label, payload) => console.log(label, payload)
@adriancmiranda
adriancmiranda / .__init.md
Created January 28, 2023 23:51 — forked from rickyalmeidadev/.__init.md
vite + react + @swc/jest
yarn create vite
@adriancmiranda
adriancmiranda / tsconfig-all.js
Created December 17, 2023 18:51 — forked from er-ant/tsconfig-all.js
tsconfig.json with comments and explanations
{
// Config for IDE to reload
"compileOnSave": true,
"exclude": [
// Specifies an array of filenames or patterns that should be skipped when resolving include.
// Default:
// ["node_modules", "bower_components", "jspm_packages"], plus the value of outDir if one is specified.
"**/*.spec.ts",
"node_modules"
],