Skip to content

Instantly share code, notes, and snippets.

@aguilarm
aguilarm / tsconfig.json
Created September 22, 2020 23:18
TypeScript config for NextJS
{
"compilerOptions": {
"target": "esnext",
"lib": [
"dom",
"dom.iterable",
"esnext"
],
"allowJs": true,
"skipLibCheck": true,
@aguilarm
aguilarm / values.yml
Last active July 20, 2020 15:54
Local Dev K8S Nginx Ingress Values
controller:
config:
client-body-buffer-size: "32M"
proxy-body-size: "1G"
proxy-buffering: "off"
proxy-read-timeout: "600"
proxy-send-timeout: "600"
retry-non-idempotent: true
enable-cors: true
use-gzip: false
@aguilarm
aguilarm / example.js
Last active January 8, 2020 15:37
Throttle/debounce React events. Live: https://codesandbox.io/s/fervent-wildflower-t6s9s
import React, { useState } from "react";
import { throttle, debounce } from "lodash";
import ReactDOM from "react-dom";
import "./styles.css";
const handleInputChange = throttle((newValue, setValue) => {
setValue(newValue);
}, 10);
@aguilarm
aguilarm / init.sh
Last active November 11, 2018 23:29
Install basic deps for a local dev ubuntu VM
#!/bin/bash
set -e
# Pre-setup - grab keys and installtion deps
sudo apt-get update && sudo apt-get install \
apt-transport-https \
ca-certificates \
curl \
software-properties-common
@aguilarm
aguilarm / init.sh
Created November 11, 2018 21:53
Script to install everything needed on an ubuntu vm for development. I use this for vms on virtualbox with windows hosts.
#!/bin/bash
set -e
# Pre-setup - grab keys and installtion deps
sudo apt-get update && sudo apt-get install \
apt-transport-https \
ca-certificates \
curl \
software-properties-common
@aguilarm
aguilarm / .zshrc
Created November 11, 2018 21:37
zshrc intended to be used on ubuntu with oh-my-zsh
# If you come from bash you might have to change your $PATH.
# export PATH=$HOME/bin:/usr/local/bin:$PATH
# Path to your oh-my-zsh installation.
export ZSH="/home/workspace/.oh-my-zsh"
# Set name of the theme to load --- if set to "random", it will
# load a random theme each time oh-my-zsh is loaded, in which case,
# to know which specific one was loaded, run: echo $RANDOM_THEME
# See https://github.com/robbyrussell/oh-my-zsh/wiki/Themes
@aguilarm
aguilarm / .vimrc
Created November 11, 2018 21:34
vimrc with some small adjustments
" Autocompletion
set wildmenu
" Allow cursor keys in insert mode
set esckeys
" Optimize for fast terminal connections
set ttyfast
" Add the g flag to search/replace by default
set gdefault
" Use UTF-8 wihtout BOM
set encoding=utf-8 nobomb
@aguilarm
aguilarm / k8sexec.sh
Last active July 26, 2018 16:28
Run kubectl exec without matching pod names exactly. Chooses only first running pod.
#!/bin/bash
# Run as k8sexec.sh POD_NAME COMMAND
# Go see if they exist
PODS=$(kubectl get pods | grep Running | grep $1)
if [ $? != 0 ]; then
echo "No running pod found matching $1"
exit $ERROR_CODE
@aguilarm
aguilarm / autosave_form_move_notification.patch
Created June 29, 2018 18:57
super small patch moving notification up a bit
diff --git a/css/autosave_form.css b/css/autosave_form.css
index ee97cc4..dfd6dde 100644
--- a/css/autosave_form.css
+++ b/css/autosave_form.css
@@ -1,8 +1,8 @@
#autosave-notification {
display: none;
position: fixed;
- bottom: 5px;
- right: 5px;
@aguilarm
aguilarm / ajax.patch
Created December 28, 2017 21:04
ajax.patch
diff --git a/js/VoteUpDown.js b/js/VoteUpDown.js
index 752baed..9dad07c 100644
--- a/js/VoteUpDown.js
+++ b/js/VoteUpDown.js
@@ -6,23 +6,31 @@
Drupal.behaviors.voteUpDown = {
attach: function (context, settings) {
- $('.vud-widget a').click(function (e) {
+ $('.vud-widget a', context).click(function (e) {