Skip to content

Instantly share code, notes, and snippets.

View programmerdave's full-sized avatar

David Rodriguez programmerdave

View GitHub Profile
@programmerdave
programmerdave / ClearSlackSavedMessages.js
Last active April 7, 2025 05:32
Remove all saved messages from your saved view in Slack
// Remove all saved messages from your saved view in Slack
// Open Slack in a web browser and log in
// Go to your Saved/Later messages screen
// Click on either In Progress, Archived, or Completed for the list you want to delete.
// F12 to raise dev console
// Paste the below
// Wait a while till it does its thing. If you need to stop it, close the tab.
(async function(x) {
@programmerdave
programmerdave / Code Formatter.gs
Last active January 31, 2025 22:54
GDocs Code Formatter
//GDocs Code Formatter
//David E. Rodriguez
//This script adds a Menu button called "Styles -> Format Code Block" to allow you to format a code block in Google Docs.
//It doesn't yet preserve or color the code but it provides a nice format for separating monospaced code within your doc
//Inspiration from: https://tanaikech.github.io/2019/03/16/modify-shading-color-of-paragraph-on-google-document-using-google-apps-script/
//TODO check if we can provide an option to keep code colors!
//TODO check if we can format small selections of lines. This script is for code blocks.
@programmerdave
programmerdave / base64util.js
Last active February 2, 2021 21:41
Simple NodeJS utility to encode / decode from base64
//Usage:
//node base64utils.js (--decode base64string | --encode file.json)
const fs = require('fs');
const path = require('path');
const myArgs = process.argv.slice(2);
let fileExists = false;
@programmerdave
programmerdave / gist:5897f46ba417c17f670434c94bdb108f
Last active May 12, 2020 01:27
Setting Up GitBash to not ask you for your SSH Key password each time

To allow your GitBash to not ask you for your SSH Key password each time, you can add this code to your .profile or .bash_profile file, whichever you have, in your User directory. This will make it so it asks you once when you start git bash and then won’t bug you again until you restart git bash.

env=~/.ssh/agent.env

agent_load_env () { test -f "$env" && . "$env" >| /dev/null ; }

agent_start () {
    (umask 077; ssh-agent >| "$env")
 . "$env" >| /dev/null ; }

Git LFS Helper Commands

Update your git bash on Windows!

FYI for anyone using git LFS on windows: git-lfs/git-lfs#3898 If you see any hooks or lfs folders in your root of your project, it’s because your git needs to be updated. It seems that without it, the lfs and hooks folders were being stored on git so that made your repo size much much bigger on bitbucket.

You can run git update-git-for-windows on git bash to update.

TL;DR: You must be on git lfs --version > 2.9.2 otherwise you will run into this issue.

_.each($(".editInPlace"), function(g){g.click()})
// wait a second for ajax to finish
_.each($("input[type=checkbox]:checked"), function(c) {c.click()})
_.each($("input[type=radio][value=1]"), function(e) {e.click()})
_.each($("input[type=radio][name=mailing_list_status][value=0]"), function(e) {e.click()})
_.each($("input[type=radio][name=evRemind][value=1]"), function(e) {e.click()})
_.each($("form[method=POST]"), function(f) {$.post(f.action, $(f).serialize(), function(e) {console.log("Unsubscribed from " + f.action)})})
First, install nginx for mac with "brew install nginx".
Then follow homebrew's instructions to know where the config file is.
To use https you will need a self-signed certificate.
Edit /usr/local/etc/nginx/nginx.conf:
--------------------
@programmerdave
programmerdave / ZipDir.py
Created April 1, 2012 21:58 — forked from kgn/ZipDir.py
Python function to zip up a directory and preserve any symlinks and empty directories.
import os
import zipfile
def ZipDir(inputDir, outputZip):
'''Zip up a directory and preserve symlinks and empty directories'''
zipOut = zipfile.ZipFile(outputZip, 'w', compression=zipfile.ZIP_DEFLATED)
rootLen = len(os.path.dirname(inputDir))
def _ArchiveDirectory(parentDirectory):
contents = os.listdir(parentDirectory)
@programmerdave
programmerdave / buildandarchive.sh
Created December 26, 2011 23:29 — forked from hramos/buildandarchive.sh
Build and Archive script from command line. Use with testflight deployment script, or upload .ipa to web server (use iOS Beta Builder to create initial manifest files)
MY_USERNAME="username"
CONFIGURATION_NAME="Ad Hoc" # Distribution, Ad Hoc...
PROJDIR="/path-to-your-xcode-project"
APPLICATION_NAME="myapplication"
PROJECT_NAME="${APPLICATION_NAME}" # .xcodeproj ommitted
TARGET_SDK="iphoneos4.2" # current sdk
PROJECT_BUILDDIR="/Users/${MY_USERNAME}/path-to-build-dir/${CONFIGURATION_NAME}-iphoneos"
TARGET_TEST_NAME="${APPLICATION_NAME}"
BUILD_HISTORY_DIR="${PROJDIR}/distribution/" # write ${APPLICATION_NAME}.IPA here
DEVELOPER_NAME="Your Name (Bundle Prefix If Applicable)" # mine was company name
@programmerdave
programmerdave / gist:1441301
Created December 7, 2011 03:26 — forked from pmuellr/gist:1004413
BBEdit Language Module for CoffeeScript
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<!--
BBEdit Language Module for CoffeeScript
Put this file in
~/Library/Application Support/BBEdit/Language Modules
or equivalent.
Based off of the examples shipped in the BBEdit SDK.