Skip to content

Instantly share code, notes, and snippets.

View nbriz's full-sized avatar

Nick Briz nbriz

View GitHub Profile
brizandrew / index.js
Created November 14, 2018 00:21
Download a Google Drive file of a given type with a JSON Web Token via Drive Api v3
* Simple Node Script for Downloading Google Drive files (Drive API v3).
* Use these instructions to get a GAPI_CLIENT_EMAIL and GAPI_PRIVATE_KEY:
* See all available types by document here:
const { JWT } = require('google-auth-library');
const { google } = require('googleapis');
const client = new JWT({
brizandrew / template.js
Created July 11, 2017 21:59
Renders a template string based on positional and keyword arguments.
* Renders a template string based on positional and keyword arguments.
* Source:
* @example
* // returns 'YAY!'
* let t1Closure = template`${0}${1}${0}!`;
* t1Closure('Y', 'A');
* @example
* // returns 'Hello World!'
* let t2Closure = template`${0} ${'foo'}!`;
brannondorsey /
Last active July 8, 2022 05:07
One Liners

Count the number of unique characters in a file

# works for linux. There is a variation for MacOS in the link ^
sed 's/\(.\)/\1\n/g' text.txt | sort | uniq -c # sort -nr # uncomment this to sort the list by frequency

Replace a string in all instances of files in a directory

kennwhite /
Last active February 24, 2024 12:19
Most VPN Services are Terrible

Most VPN Services are Terrible

Short version: I strongly do not recommend using any of these providers. You are, of course, free to use whatever you like. My TL;DR advice: Roll your own and use Algo or Streisand. For messaging & voice, use Signal. For increased anonymity, use Tor for desktop (though recognize that doing so may actually put you at greater risk), and Onion Browser for mobile.

This mini-rant came on the heels of an interesting twitter discussion:

An Open Letter to Young Software Authors

By Brannon Dorsey

I harbor a great fear that we have become overwhelmingly misguided in our mass popularization of networked computing and large-scale reliance/transcendence of proprietary software into our personal and social lives. We have strayed far from some of the revolutionary ideas from which the internet and personal computing were birthed and if our present trajectory is left unaltered the technological future we will find ourselves in is not overwhelmingly bright. It is for this reason that I feel compelled to speak up, asking much from young software authors like myself that are finding their skills so ever more in-demand and who I know care so deeply for the future of a media in which they have found such connection, challenge, and personal achievement.

For them (and others), this document is intended to present a perspective of technological positivism at its core layered deeply under a mantle of skepticism regarding aggr

nbriz / leave_facebook.js
Last active October 16, 2018 10:36 — forked from subimage/jquery-2.1.1.min.js
all-in-one script ( with parameters ) >> big thnx to @subimage && xtra updates by Luigi DiGangi
// forked from subimage's modifications of my much messier prior scripts
// ( )
// after entering jquery into ur console, enter the code below in ur console
// then load a few months of activity && enter leaveFacebook(); into ur console
// u can specify parameters like so: leaveFacebook('Unlike'); if u only want to unlike
// or leaveFacebook('Unfriend'); if u only want to unfriend
// etc...
// visit for vidz && details
subimage / jquery-2.1.1.min.js
Last active August 20, 2018 19:44
Refined version of @nbriz's "Leave Facebook" collection
/*! jQuery v2.1.1 | (c) 2005, 2014 jQuery Foundation, Inc. | */
!function(a,b){"object"==typeof module&&"object"==typeof module.exports?module.exports=a.document?b(a,!0):function(a){if(!a.document)throw new Error("jQuery requires a window with a document");return b(a)}:b(a)}("undefined"!=typeof window?window:this,function(a,b){var c=[],d=c.slice,e=c.concat,f=c.push,g=c.indexOf,h={},i=h.toString,j=h.hasOwnProperty,k={},l=a.document,m="2.1.1",n=function(a,b){return new n.fn.init(a,b)},o=/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,p=/^-ms-/,q=/-([\da-z])/gi,r=function(a,b){return b.toUpperCase()};n.fn=n.prototype={jquery:m,constructor:n,selector:"",length:0,toArray:function(){return},get:function(a){return null!=a?0>a?this[a+this.length]:this[a]},pushStack:function(a){var b=n.merge(this.constructor(),a);return b.prevObject=this,b.context=this.context,b},each:function(a,b){return n.each(this,a,b)},map:function(a){return this.pushStack(,function(b,c){return,
yyolk /
Last active December 25, 2015 00:49
grab all JPEGs, PNGs, and GIFs from Chrome's cache (useful for when someone deletes a post)
mkdir -p $TMP_DIR
for i in $(file $CHROME_CACHE/* | egrep -i 'jp|gif|png' |awk '{print $1}' | sed 's/://g'); do cp -v $i $TMP_DIR/`basename $i`.$(file $i | awk '{print tolower($2)}') ; done