Skip to content

Instantly share code, notes, and snippets.

View vishvish's full-sized avatar
:octocat:
Busy being an antifascist

Vish vishvish

:octocat:
Busy being an antifascist
View GitHub Profile
@vishvish
vishvish / photos.js
Created March 11, 2025 08:19 — forked from AshKyd/photos.js
Delete photos, videos, and reviews from the Google Maps desktop site. Huge disclaimer: these will probably get out of date at some point and may not work. You should read and understand the code before you do anything with it.
// delete photos from Google Maps
(async () => {
const sleep = (time) => new Promise(resolve => setTimeout(resolve,time));
const go = async () => {
// click the kebab
document.querySelector('button[jsaction*="pane.photo.actionMenu"]:not([aria-hidden="true"])').click();
await sleep(200);
// click the delete menu item
document.querySelector('#action-menu div[role="menuitemradio"]').click();
@vishvish
vishvish / model.rb
Created April 18, 2023 14:46 — forked from cblunt/model.rb
A tiny concern for generating a UUID for a model. Code heavily based off Rails' `has_secure_token` method
class Model < ActiveRecord::Base
include UuidConcern
# uuid attribute is `:uuid` by default. Optionally pass in attribute name, e.g `has_uuid :unique_token`
has_uuid
end
@vishvish
vishvish / .Dockerfile
Created May 18, 2022 12:20 — forked from kinoute/.Dockerfile
Example of Ruby on Rails 6 Multi-stage builds with Docker. Development/production environments share the same Dockerfile.
FROM ruby:2.7.1-slim AS base
LABEL maintainer="Yann Defretin <yann@defret.in"
# Common dependencies
RUN apt-get update -qq \
&& DEBIAN_FRONTEND=noninteractive apt-get install -yq \
--no-install-recommends \
build-essential=12.6 \
gnupg2=2.2.12-1+deb10u1 \
@vishvish
vishvish / touchid_sudo.sh
Last active December 15, 2022 22:43 — forked from RichardBronosky/touchid_sudo.sh
Use TouchID for sudo on modern MacBook Pro machines
#!/bin/bash
# curl -sL https://gist.githubusercontent.com/vishvish/70d12682c29927dabbeb48fa7b3defca/raw/touchid_sudo.sh | bash
# This script is ready to copy-paste in whole, or just the line above (without the leading #)
# Use TouchID for sudo on modern MacBook Pro machines
# This script adds a single line to the top of the PAM configuration for sudo
# See: https://apple.stackexchange.com/q/259093/41827 for more info.
touchid_sudo(){
@vishvish
vishvish / recovery.sh
Created July 21, 2019 19:02 — forked from jonathantneal/recovery.sh
Create or update macOS Mojave Recovery Partition Without Reinstalling
#!/bin/sh
# Set the macOS installer path as a variable
MACOS_INSTALLER="/Applications/$(ls /Applications | grep "Install macOS")"
MOUNT_POINT="$MACOS_INSTALLER/Contents/SharedSupport"
echo "macOS installer is \"$MACOS_INSTALLER\""
# Set the target disk as a variable
TARGET=$(diskutil info "$(bless --info --getBoot)" | awk -F':' '/Volume Name/ { print $2 }' | sed -e 's/^[[:space:]]*//')
echo "Target disk is \"$TARGET\""
@vishvish
vishvish / hosts
Created December 17, 2017 22:39 — forked from consti/hosts
/etc/hosts to block shock sites etc.
# This hosts file is brought to you by Dan Pollock and can be found at
# http://someonewhocares.org/hosts/
# You are free to copy and distribute this file for non-commercial uses,
# as long the original URL and attribution is included.
#<localhost>
127.0.0.1 localhost
127.0.0.1 localhost.localdomain
255.255.255.255 broadcasthost
::1 localhost
@vishvish
vishvish / docker_command
Created July 6, 2016 01:28 — forked from likwid/docker_command
Postgres with ssl in docker
#This isn't very secure, but its for demo purposes
docker run --name postgres -e POSTGRES_PASSWORD=password -d -p 54320:5432 \
-v $(pwd)/postgresql.conf:/srv/postgresql.conf \
-v $(pwd)/server.crt:/srv/server.crt \
-v $(pwd)/server.key:/srv/server.key \
-v $(pwd)/reconfigure_postgres.sh:/docker-entrypoint-initdb.d/reconfigure_postgres.sh \
postgres:9.5
@vishvish
vishvish / tmux-cheatsheet.markdown
Created April 13, 2016 09:38 — forked from MohamedAlaa/tmux-cheatsheet.markdown
tmux shortcuts & cheatsheet

tmux shortcuts & cheatsheet

start new:

tmux

start new with session name:

tmux new -s myname
@vishvish
vishvish / DispatchGroupDemo.swift
Created December 29, 2015 00:03 — forked from kristopherjohnson/DispatchGroupDemo.swift
Simple demo of dispatch_group_async/dispatch_group_notify/dispatch_group_wait in Swift
import Foundation
let notified = dispatch_semaphore_create(0)
let group = dispatch_group_create()
let queue = dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0)
for n in 0..<20 {
dispatch_group_async(group, queue) {
let timeInterval = Double(arc4random_uniform(1000)) * 0.01
@vishvish
vishvish / gist:4163de24fb38b6be0c6e
Created November 11, 2015 09:35 — forked from j3j5/gist:8b3e48ccad746b90a54a
Adyen Test Card Numbers
Adyen Test Card Numbers
These cards are only valid on our TEST system and they will never involve any actual transaction or transfer of funds. The TEST card numbers will not work on the Adyen LIVE Platform.
For all cards use the following expiration and CVV2/CVC2/or CID for Amex.
For all cards:
Expiration Dates CVV2 / CVC3 CID (American Express)
06/2016 OR 08/2018 737 7373