Skip to content

Instantly share code, notes, and snippets.

View kidpollo's full-sized avatar
💁‍♂️
Potato farming

Paco Viramontes kidpollo

💁‍♂️
Potato farming
  • San Francisco, CA
View GitHub Profile
@kidpollo
kidpollo / index.js
Last active June 13, 2024 07:55 — forked from auchenberg/index.js
Script to delete all Google Photos from console (2024)
const maxCount = 5000;
const counterSelector = '.rtExYb';
const checkboxSelector = '.ckGgle[aria-checked=false]';
const photoDivSelector = ".yDSiEe.uGCjIb.zcLWac.eejsDc.TWmIyd";
const deleteButtonSelector = 'button[aria-label="Delete"]';
const confirmationButtonSelector = '#yDmH0d > div.VfPpkd-Sx9Kwc.cC1eCc.UDxLd.PzCPDd.V639qd.bvQPzd.oEOLpc.A9Uzve.VfPpkd-Sx9Kwc-OWXEXe-FNFY6c > div.VfPpkd-wzTsW.O4g5Md.iWO5td > div > div.VfPpkd-cnG4Wd.m5OsGf > div > div.VfPpkd-T0kwCb.IdSMxc > button.VfPpkd-LgbsSe.VfPpkd-LgbsSe-OWXEXe-k8QpJ.nCP5yc.AjY5Oe.LQeN7.kDryjd';
async function deleteGooglePhotos() {
// Retrieves the current count of selected photos
const getCount = () => {
@kidpollo
kidpollo / local.cljs
Last active March 2, 2023 00:52
nbb + ruuter + axios node proxy
(ns local
{:clj-kondo/config '{:lint-as {promesa.core/let clojure.core/let
applied-science.js-interop/fn clojure.core/fn
applied-science.js-interop/defn clojure.core/defn}}}
(:require [cljs-bean.core :refer [->clj ->js]]
[promesa.core :as p]
["http" :as http]
["url"]
[applied-science.js-interop :as j]
[clojure.string :as string]
@kidpollo
kidpollo / proxy.cljs
Last active February 24, 2023 02:05
NBB + Ruuter + Axios Lambda API proxy
(ns foo
{:clj-kondo/config '{:lint-as {promesa.core/let clojure.core/let
applied-science.js-interop/defn clojure.core/defn}}}
(:require [cljs-bean.core :refer [->clj ->js]]
[ruuter.core :as ruuter]
["axios$default" :as axios]
[clojure.string :as string]
[promesa.core :as p]
[applied-science.js-interop :as j]))
@kidpollo
kidpollo / nginx.conf
Created April 8, 2017 08:18
Simple nginx ssl proxy configiration for local development
# do https://gist.github.com/jed/6147872 and then do this to proxy your app
worker_processes 1;
events {
worker_connections 1024;
}
http {
server {
listen 80;
@kidpollo
kidpollo / bootstrap.sh
Last active July 11, 2022 02:44
osx bootstrap
# Install iterm 2 https://www.iterm2.com/
# Install 1password
#install homebrew
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
echo 'eval "$(/opt/homebrew/bin/brew shellenv)"' >> /Users/paks/.zprofile
eval "$(/opt/homebrew/bin/brew shellenv)"
# packages
brew install git git-crypt gpg autojump kube-ps1 stern asdf rlwrap rg
require 'mail'
require 'thread'
require 'parallel'
require 'benchmark'
Mail.defaults do
delivery_method :smtp, options
end
@kidpollo
kidpollo / keybase.md
Created September 23, 2016 06:10
Keybase proof

Keybase proof

I hereby claim:

  • I am kidpollo on github.
  • I am kidpollo (https://keybase.io/kidpollo) on keybase.
  • I have a public key ASD3Rhho5U14SMrLQ9gNilg9-YssXS9hiovYVCkqFw3aFwo

To claim this, I am signing this object:

@kidpollo
kidpollo / monty-hall.clj
Created May 8, 2015 17:03
Monty Hall problem
(defn monty-hall
""
[]
(let [prize-idx (rand-int 3)
doors [false false false]
doors (assoc doors prize-idx true)
random-pick (rand-int 3)
monty-pick (first
(remove nil? (map-indexed
(fn [idx val]
(defn make-change [x coinset]
(loop [x x
change []]
(let [possible-coins (take-while #(when (>= x %) %) coinset)
current-coin (some #(when (zero? (rem x %)) %) possible-coins)]
(cond
(= x (reduce + possible-coins))
(concat possible-coins change)
(= x 0)
change
(ns sudoku-validator.core)
(defn is-valid-solution [grid]
(let [rows (partition-all 9 (map (comp read-string str) grid))
cols (apply map (comp seq vector) rows)
squares (map
flatten
(partition-all
3
(for [base (range 3)