Skip to content

Instantly share code, notes, and snippets.

View spookyuser's full-sized avatar
🌎
reading and writing

spookyuser

🌎
reading and writing
View GitHub Profile
@spookyuser
spookyuser / AddCookiesInterceptor.kt
Last active July 16, 2017 22:27 — forked from nikhiljha/AddCookiesInterceptor.java
Retrofit2/OkHttp3 Cookies (Drag and Drop, One Size Fits 99%)
import android.content.SharedPreferences
import okhttp3.Interceptor
import okhttp3.Response
import org.threeten.bp.Instant
import timber.log.Timber
import java.io.IOException
import java.util.*
import javax.inject.Inject
/**
@spookyuser
spookyuser / install_ffmpeg.sh
Last active December 28, 2019 07:07 — forked from loong/Install ffmpeg on AWS Linux AMI
Installs FFmpeg on aws\whatever
# Taken from https://forums.aws.amazon.com/thread.jspa?messageID=332091
# And https://gist.github.com/rainabba/07425c3bc14a0bb51632f12e913d9081
#
# Usage: `sudo bash ./install_ffmpeg.sh`
# Config Variables
static_host=https://johnvansickle.com/ffmpeg/builds/ffmpeg-git-64bit-static.tar.xz
filename=ffmpeg-git-64bit-static.tar.xz
@spookyuser
spookyuser / ThisWorkbook.bas
Last active January 23, 2023 06:19
A combination of 2 super cool vba scripts that, together, allow you to distribute a simple button enabled excel macro without an installer
' All code comes from the following places:
' - https://stackoverflow.com/a/41546218/1649917
' - https://www.ozgrid.com/VBA/excel-add-in-create.htm
Option Explicit
Dim cControl As CommandBarButton
' Set it to True to be able to Debug install mechanism
Const bVerboseMessages = False
' Will be use to verify if the procedure has already been run
@spookyuser
spookyuser / Dockerfile
Created October 3, 2022 10:06
Baking sentence transformers into docker
FROM python:3.10.7-slim as base
ENV PYTHONFAULTHANDLER=1 \
PYTHONUNBUFFERED=1 \
PYTHONHASHSEED=random \
PIP_NO_CACHE_DIR=off \
PIP_DISABLE_PIP_VERSION_CHECK=on \
PIP_DEFAULT_TIMEOUT=100 \
PIPENV_NOSPIN=true \
NUMBA_CACHE_DIR=/tmp \
@spookyuser
spookyuser / brew_uninstall.fish
Created July 27, 2023 08:54
Brew uninstall !! for fish !! yay !!
function brew
if test (count $argv) -gt 0
if test $argv[1] = "install"
/opt/homebrew/bin/brew $argv
if test $status -eq 0
echo $argv[2..-1] > /tmp/.brew_last_installed
end
return
else if test $argv[1] = "uninstall" -a $argv[2] = "!!"
if test -f /tmp/.brew_last_installed
@spookyuser
spookyuser / detele_vercel_envs.sh
Last active September 14, 2023 14:51
kinda delete all vercel envs.sh
# Step 1: List all environment variables and store them in a variable
env_vars=$(vercel env ls)
# Step 2: Parse the output to get variable names (assuming the names are in the first column)
# This step can vary based on the actual output format of `vercel env ls`
env_var_names=$(echo "$env_vars" | awk '{if(NR>2) print $1}')
# Step 3: Loop through each environment variable name and remove it
for name in $env_var_names
do
@spookyuser
spookyuser / yt.fish
Created September 19, 2023 09:24
i love this
function mp4
set video_url $argv[1]
yt-dlp mp4 $video_url
end
function mp3
set video_url $argv[1]
yt-dlp -x --audio-format mp3 --audio-quality 0 $video_url
end
@spookyuser
spookyuser / NEXT_TYPESCRIPT.json
Created October 9, 2023 09:17 — forked from anandmt/NEXT_TYPESCRIPT.json
VSCODE_SNIPPETS
{
"Next Typescript React Functional Component": {
"prefix": "fc",
"body": [
"import { FC } from 'react';",
"",
"interface ${TM_FILENAME_BASE}Props {",
" $1",
"}",
"",
@spookyuser
spookyuser / big_firebase_backup.sh
Last active October 10, 2023 17:21
Big firebase backup
#! /bin/bash
# Manual stuff
# Install gcloud sdk: https://cloud.google.com/sdk/docs/install
# Install firebase tools: https://firebase.google.com/docs/cli#install_the_firebase_cli
# Login to firebase: firebase login
# Login to gcloud: gcloud auth login
GCLOUD_PROJECT_ID=xxxx
BACKUP_BUCKET=gs://backups-$GCLOUD_PROJECT_ID-firebase
#! /bin/bash
# Manual stuff
# Install gcloud sdk: https://cloud.google.com/sdk/docs/install
# Install firebase tools: https://firebase.google.com/docs/cli#install_the_firebase_cli
# Login to firebase: firebase login
# Login to gcloud: gcloud auth login
# Global variables
DATE=$(date +%Y-%m-%d)
BACKUP_FOLDER=firebase-backup-$DATE