Skip to content

Instantly share code, notes, and snippets.

View skwid138's full-sized avatar
🐅
Tiger Style

Hunter Rancourt skwid138

🐅
Tiger Style
View GitHub Profile
@chranderson
chranderson / nvmCommands.js
Last active May 6, 2024 14:15
Useful NVM commands
// check version
node -v || node --version
// list locally installed versions of node
nvm ls
// list remove available versions of node
nvm ls-remote
// install specific version of node
@russkociuba
russkociuba / iterm2_script_tabs.scpt
Created November 28, 2016 21:12
Opens a new iTerm2 window with multiple tabs each executing a command set in the script
# The list of commands to run in each tab of the terminal window
set cmdList to {"ssh user@host1.example.com", "ssh user@host2.example.com"}
# You can append to the list just to break up really long lines
# set cmdList to cmdList & {"ssh user@host3.example.com"}
tell application "iTerm2"
# Not sure how to create an "empty" window so for the window we pick the
# first command in the list
@lukechilds
lukechilds / get_latest_release.sh
Created August 9, 2016 19:43
Shell - Get latest release from GitHub
get_latest_release() {
curl --silent "https://api.github.com/repos/$1/releases/latest" | # Get latest release from GitHub api
grep '"tag_name":' | # Get tag line
sed -E 's/.*"([^"]+)".*/\1/' # Pluck JSON value
}
# Usage
# $ get_latest_release "creationix/nvm"
# v0.31.4
@harto
harto / before.js
Created April 20, 2016 17:33
Mocha before() & beforeEach() execution order with nested describe()
'use strict';
describe('mocha before hooks', function () {
before(() => console.log('*** top-level before()'));
beforeEach(() => console.log('*** top-level beforeEach()'));
describe('nesting', function () {
before(() => console.log('*** nested before()'));
beforeEach(() => console.log('*** nested beforeEach()'));
it('is a nested spec', () => true);
});
@fostertime
fostertime / wp_remove_header_junk.php
Last active February 17, 2022 09:18
Remove All Unwanted Meta, Scripts and Styles (including Emoji) from the WordPress Header.
// =========================================================================
// REMOVE JUNK FROM WORDPRESS HEAD
// =========================================================================
// REMOVE WORDPRESS HEADER META:
remove_action('wp_head', 'rsd_link'); // remove really simple discovery link
remove_action('wp_head', 'wp_generator'); // remove wordpress version meta tag
remove_action('wp_head', 'feed_links', 2); // remove rss feed links (make sure you add them in yourself if youre using feedblitz or an rss service)
remove_action('wp_head', 'feed_links_extra', 3); // removes all extra rss feed links
remove_action('wp_head', 'index_rel_link'); // remove link to index page
remove_action('wp_head', 'wlwmanifest_link'); // remove wlwmanifest.xml (needed to support windows live writer)
@wosephjeber
wosephjeber / ngrok-installation.md
Last active May 6, 2024 20:19
Installing ngrok on Mac

Installing ngrok on OSX

For Homebrew v2.6.x and below:

brew cask install ngrok

For Homebrew v2.7.x and above:

@maxtruxa
maxtruxa / Antonyms.md
Last active May 6, 2024 09:31
A list of common terms used in programming and their respective antonyms.

Antonym List

Note: The table headings (positive/negative) are not necessarily meaningful.

Positive Negative
acquire release
add remove (e.g. an item), subtract (arithmetic)
advance retreat
allocate deallocate (correct), free (common)
allow deny
@vitorbritto
vitorbritto / rm_mysql.md
Last active May 6, 2024 20:07
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
    
@bubba-h57
bubba-h57 / closeConnection.php
Created January 14, 2015 21:39
Easy way to close connections to the browser and continue processing on the server.
<?php
/**
* Close the connection to the browser but continue processing the operation
* @param $body
*/
public function closeConnection($body, $responseCode){
// Cause we are clever and don't want the rest of the script to be bound by a timeout.
// Set to zero so no time limit is imposed from here on out.
set_time_limit(0);
@brock
brock / nodereinstall.sh
Last active April 17, 2024 08:26
Complete Node Reinstall. I've moved this to a repo at http://git.io/node-reinstall
#!/bin/bash
# node-reinstall
# credit: http://stackoverflow.com/a/11178106/2083544
## program version
VERSION="0.0.13"
## path prefix
PREFIX="${PREFIX:-/usr/local}"