Skip to content

Instantly share code, notes, and snippets.

@lmj0011
lmj0011 / jquery-scroll-bottom.js
Created June 19, 2016 07:49 — forked from toshimaru/jquery-scroll-bottom.js
Detect the scrolling to bottom of the page using jQuery.
$(window).on("scroll", function() {
var scrollHeight = $(document).height();
var scrollPosition = $(window).height() + $(window).scrollTop();
if ((scrollHeight - scrollPosition) / scrollHeight === 0) {
// when scroll to bottom of the page
}
});
@lmj0011
lmj0011 / gitHubCherryPicking.md
Last active March 21, 2018 21:48
Remove Minus and Plus Signs when cherrypicking Github Commits

Open up the web console while viewing the file(s) of a commit on Github and paste in this snippet:

var added_nodes = document.querySelectorAll(".blob-code.blob-code-addition .blob-code-inner");
var deleted_nodes = document.querySelectorAll(".blob-code.blob-code-deletion .blob-code-inner");
// var neutral_nodes = document.querySelectorAll(".blob-code.blob-code-context .blob-code-inner"); //don't think one is necessary
var str, new_str, pieces;

function removeNodes(nodes) {
 for(var i=0; i < nodes.length; i++) {
@lmj0011
lmj0011 / gitCheck.md
Last active August 22, 2024 18:18 — forked from mzabriskie/README.md
Check git status of multiple repos

Usage:

gitCheck [directory]

This will run git status on each repo under the directory specified. If called with no directory provided it will default to the current directory.


Changes

@lmj0011
lmj0011 / 0_reuse_code.js
Created December 26, 2016 04:34
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
@lmj0011
lmj0011 / RDS-Aurora-CloudFormation-Example.yaml
Created August 30, 2017 06:56 — forked from sjparkinson/RDS-Aurora-CloudFormation-Example.yaml
A basic CloudFormation template for an RDS Aurora cluster.
---
AWSTemplateFormatVersion: 2010-09-09
Description: A basic CloudFormation template for an RDS Aurora cluster.
Parameters:
DatabaseInstanceType:
Default: db.r3.large
AllowedValues:
- db.r3.large
- db.r3.xlarge
- db.r3.2xlarge
@lmj0011
lmj0011 / my.cnf
Last active May 27, 2018 20:13 — forked from chrisjlee/my.cnf
my.cnf file optimized for InnoDB 64bit setups
# forked from https://gist.github.com/chrisjlee/2973469
[client]
#password = [your_password]
#port = 3306
#socket = /tmp/mysqld.sock
# *** Application-specific options follow here ***
#
@lmj0011
lmj0011 / rejson-for-ubuntu.md
Last active November 4, 2024 10:18
Building and Loading the ReJSON v1 Module on Linux Ubuntu 16.04 for Redis

make sure you have at least redis v4.0+

redis-server --version

redis-cli --version

install the build-essential package

apt-get install build-essential

@lmj0011
lmj0011 / rename.sh
Last active February 11, 2019 12:25
slugify filenames in the current directory
# c/p this into current directory
# note - does not remove special chars
rename -v 'y/A-Z/a-z/' * && rename -v 's/ /-/g' *
@lmj0011
lmj0011 / textnow-conversation-purger.js
Created July 25, 2019 09:31
Delete All Conversations From Your TextNow Account
(async function () {
let lastGlobalId;
let fetchUrl;
let bigOleArrayOfContacts = [];
const USERNAME_QUERY_SELECTOR = "#recent-header > div.account-details > div.name";
const CSRF_TOKEN_QUERY_SELECTOR = "meta[name=csrf-token]";
console.log("Script has started.");