Skip to content

Instantly share code, notes, and snippets.

@henderea
henderea / scripts.txt
Last active June 7, 2018 14:38
List of scripts
27a5bf48dd5c5610dda624b8d3af24bb check_open_files.rb
764b427cde1a7fa562b7fe8427aedb51 create-webpack.sh
982f84ad2f7b3609802aa6cfe64ae576 local-ssl-create.sh
46bce664c7463d8588c786cffd5a1ffd clone_repo.rb
6bda431d92d5b3769ef5ee93c3d355e6 git-svn-prune.sh
ccadcd4e5bc0f0908d91272d9366de98 git-svn-relocate.rb
74016363040a932c3fcac61c7ca7efd7 my-service.sh
#!/usr/bin/env ruby
STDOUT.sync = true
if `which sysctl`.include?('sysctl')
num_files = `sysctl -n kern.num_files 2>/dev/null`.strip
puts "\e[1mOpen files:\e[0m #{num_files}" if num_files != ''
maxfiles = `sysctl -n kern.maxfiles 2>/dev/null`.strip
puts "\e[1mOverall limit:\e[0m #{maxfiles}" if maxfiles != ''
@henderea
henderea / .inputrc
Created October 26, 2017 19:24
My .inputrc
# Make Tab autocomplete regardless of filename case
# set completion-ignore-case on
# List all matches in case multiple possible completions are possible
# set show-all-if-ambiguous on
# Immediately add a trailing slash when autocompleting symlinks to directories
set mark-symlinked-directories on
# Use the text that has already been typed as the prefix for searching through
@henderea
henderea / create-webpack.sh
Last active March 31, 2024 15:30
A script for creating a project with my webpack template
#!/usr/bin/env bash
NAME="$1"
GH_USER="henderea"
GH_REPO="webpack-template"
TEMP_DIR=$(mktemp -d -t webpack-template-XXX)
ZIP_NAME="$TEMP_DIR/webpack-template-master.zip"
curl -sSL -o "$ZIP_NAME" "https://github.com/$GH_USER/$GH_REPO/archive/master.zip"
unzip "$ZIP_NAME" -d "$TEMP_DIR"
mv "$TEMP_DIR/webpack-template-master" "$1"
@henderea
henderea / apply-epichrome-patch.sh
Last active July 19, 2017 22:10
apply-epichrome-patch.sh
#!/bin/bash
function fail {
echo "Encountered error: $1"
exit 1
}
if [ ! -s /usr/local/bin/brew ]; then
xcode-select --install
echo "Installing Homebrew"
@henderea
henderea / switch-epichrome-python.sh
Last active May 27, 2017 19:24
switch-epichrome-python.sh
#!/bin/bash
function fail {
echo "Encountered error: $1"
exit 1
}
if [ ! -s /usr/local/bin/brew ]; then
xcode-select --install
echo "Installing Homebrew"
@henderea
henderea / purge-watch.rb
Last active February 23, 2017 18:22
purge-watch.rb: run it as root on mac and it will automatically purge when the free memory goes below the threshold
#!/usr/bin/env ruby
# MUST BE RUN AS ROOT. You can set it up in Launch Daemons (/Library/LaunchDaemons/*.plist) to have it start on login.
# Using the LaunchControl app, add it under "Global Daemons". In LingonX, set it to run as root.
# You also need growlnotify installed at "/usr/local/bin/growlnotify". You can install it with "brew cask install growlnotify"
# To disable growl notifications, set the key :growl_enable to false in purge-watch-settings.yaml (see below)
# You can now set a maximum time to wait before running a purge. If the free memory isn't low enough to trigger the purge,
# settings the max wait will cause it to still purge if it has been at least :max_wait seconds since the last purge.
# It defaults to being off, but any POSITIVE value (doesn't include 0) will cause it to not wait more than that amount of time
@henderea
henderea / fix_ruby_openssl.sh
Created February 13, 2017 21:00
Should fix the openssl errors for an rvm-installed ruby on macOS Sierra
#!/bin/sh
# Pass the ruby versions to fix as arguments. For example,
# $ ./fix_ruby_openssl.sh 2.4.0 2.3.1 2.2.5
for rv in "$@"
do
echo rvm uninstall "$rv"
rvm uninstall "$rv"
done
@henderea
henderea / output.xml
Created May 7, 2016 18:00
./liste_dossier2.rb -s . -x output.xml
<?xml version="1.0"?>
<rootfs id="/Users/erichenderson/henderea@gmail.com/Cinquin Programming/liste_dossiers">
<file label=".DS_Store" mtime="2016-05-07 13:58:28 -0400" path="/.DS_Store" size="6148"/>
<folder label="lib" mtime="2016-05-07 13:54:19 -0400" path="/lib" size="272">
<file label=".DS_Store" mtime="2016-05-07 13:54:20 -0400" path="/lib/.DS_Store" size="6148"/>
<file label="ansi-to-html.rb" mtime="2016-03-11 17:36:29 -0500" path="/lib/ansi-to-html.rb" size="5334"/>
<file label="build_xml.rb" mtime="2016-05-07 13:49:59 -0400" path="/lib/build_xml.rb" size="611"/>
<file label="fonctions.rb" mtime="2016-04-29 07:39:30 -0400" path="/lib/fonctions.rb" size="4287"/>
<file label="listing.rb" mtime="2016-04-29 07:40:13 -0400" path="/lib/listing.rb" size="5268"/>
<file label="unused_functions_from-trying-to-output-xml.rb" mtime="2016-04-29 07:39:35 -0400" path="/lib/unused_functions_from-trying-to-output-xml.rb" size="1830"/>

Keybase proof

I hereby claim:

  • I am henderea on github.
  • I am henderea (https://keybase.io/henderea) on keybase.
  • I have a public key whose fingerprint is 58D1 3BCC 3FF1 9E65 2A2E BA6F F093 460F 2FD9 32E7

To claim this, I am signing this object: