Skip to content

Instantly share code, notes, and snippets.

Avatar
🏠
Working from home

Nick Caballero nickcaballero

🏠
Working from home
View GitHub Profile
@nickcaballero
nickcaballero / snippet.js
Created Aug 3, 2021
CVS Check Appointment Snippet
View snippet.js
$('div button.red').each((i,t) => setTimeout(() => t.click(), 1000 * i))
@nickcaballero
nickcaballero / babylist-total.js
Last active Mar 3, 2021
Babylist sum of registry items
View babylist-total.js
// Run this in console
[...document.querySelectorAll('.mtm')]
.map(group => [...group.querySelectorAll('.offer-price')]
.map(element => parseFloat(element.textContent.substring(1)))
.reduce((agg, value, i) => (agg + value) / (i ? 2 : 1), 0)) // Take average when product is available on multiple sites
.reduce((sum, value) => sum + value, 0)
@nickcaballero
nickcaballero / build.sh
Last active Oct 15, 2017
Script to configure NordVPN using OpenVPN on DD-WRT
View build.sh
#!/usr/bin/env bash
# Script to initialize OpenVPN on DD-WRT firmware
TUN=tun0
ROUTER_USER=root
ROUTER_HOST=192.168.1.1
ROUTER_SSH=$ROUTER_USER@$ROUTER_HOST
CONFIG_URL=https://nordvpn.com/api/files/zip
# Pipe input to a file on the router
View Dexter.java
public class Dexter {
private static String optimizedDirectory = "optimized";
private static String workDirectory = "working";
public static void loadFromAssets(Context context, String fileName) throws Exception {
File optimized = new File(optimizedDirectory);
optimized = context.getDir(optimized.toString(), Context.MODE_PRIVATE);
optimized = new File(optimized, fileName);