Skip to content

Instantly share code, notes, and snippets.

View drewbrokke's full-sized avatar
🦆
work work work

Drew Brokke drewbrokke

🦆
work work work
View GitHub Profile
@jboner
jboner / latency.txt
Last active July 21, 2024 15:49
Latency Numbers Every Programmer Should Know
Latency Comparison Numbers (~2012)
----------------------------------
L1 cache reference 0.5 ns
Branch mispredict 5 ns
L2 cache reference 7 ns 14x L1 cache
Mutex lock/unlock 25 ns
Main memory reference 100 ns 20x L2 cache, 200x L1 cache
Compress 1K bytes with Zippy 3,000 ns 3 us
Send 1K bytes over 1 Gbps network 10,000 ns 10 us
Read 4K randomly from SSD* 150,000 ns 150 us ~1GB/sec SSD
@vitorbritto
vitorbritto / rm_mysql.md
Last active July 5, 2024 17:22
Remove MySQL completely from Mac OSX

Remove MySQL completely

  1. Open the Terminal

  2. Use mysqldump to backup your databases

  3. Check for MySQL processes with: ps -ax | grep mysql

  4. Stop and kill any MySQL processes

  5. Analyze MySQL on HomeBrew:

    brew remove mysql
    
# see https://www.topbug.net/blog/2013/04/14/install-and-use-gnu-command-line-tools-in-mac-os-x/
# core
brew install coreutils
# key commands
brew install binutils
brew install diffutils
brew install ed --default-names
brew install findutils --with-default-names
@drewbrokke
drewbrokke / getlatestpr.py
Last active July 28, 2016 21:54
Get Latest PR from Liferay JIRA Ticket
"""
Opens the latest pull request registered to a JIRA ticket.
You can call it from the Liferay repo to check your current branch,
or you can pass in a ticket number as an argument.
"""
import json
import sys
import urllib2
import webbrowser
@kenjiheigel
kenjiheigel / ci.xml
Last active October 10, 2018 17:24
Backend Test Results Generator
<?xml version="1.0"?>
<project basedir="." default="generate-backend-results" name="ci" xmlns:antelope="antlib:ise.antelope.tasks">
<import file="build-test.xml" />
<target name="prepare-classpath">
<gradle-execute dir="modules/test/jenkins-results-parser" task="jar" />
<copy todir="lib/development">
<fileset dir="tools/sdk/dist" includes="com.liferay.jenkins.results.parser*.jar" />
@drewbrokke
drewbrokke / nscript
Last active October 16, 2020 22:37
nscript - script management for the 22nd century
#!/bin/bash
NSCRIPT_SCRIPT_DIR="${NSCRIPT_SCRIPT_DIR:?Please set the "NSCRIPT_SCRIPT_DIR" environment variable. nscript will use it for storing shell scripts}"
if [[ ! -d "${NSCRIPT_SCRIPT_DIR}" ]]
then
echo "The NSCRIPT_SCRIPT_DIR value \"${NSCRIPT_SCRIPT_DIR}\" is not a valid directory."
exit 1
fi
@drewbrokke
drewbrokke / README.md
Created February 28, 2018 17:14
Move language keys from one directory to another

moveLang

Usage

moveLang \
  -k "key-one key-two key-three" \
  -s modules/apps/foundation/contacts/contacts-web/src/main/resources/content \
  -t portal-impl/src/content
@tomhicks
tomhicks / plink-plonk.js
Last active July 16, 2024 02:59
Listen to your web pages
@drewbrokke
drewbrokke / gm.bash
Last active October 22, 2020 15:47
Quickly `cd` to an OSGi module
# Running this will display a filterable list of modules
# Once you select one, you will navigate to it
# You can call it with an argument to be used as a pre-filter on the module list
# Requires 'fzf', I highly recommend it.
# https://github.com/junegunn/fzf
# In this case, 'fzf' is reading from stdin
# USAGE EXAMPLES
# gm (will present the full list of modules)
@drewbrokke
drewbrokke / packages.md
Last active June 9, 2020 19:36
Low-to-NO-dependency NPM packages