Skip to content

Instantly share code, notes, and snippets.

🌴
On vacation

Nathaniel nathanielove

🌴
On vacation
Block or report user

Report or block nathanielove

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View load-jquery.js
// Anonymous "self-invoking" function
(function() {
// Load the script
var script = document.createElement("SCRIPT");
script.src = 'https://code.jquery.com/jquery-3.3.1.min.js';
script.type = 'text/javascript';
script.onload = function() {
var $ = window.jQuery;
// Use $ here...
};
View leetcode-question-counter.js
$(function() {
let titleDOM = $('th.reactable-th-question_title').children('strong');
let statusDOM = $('th.reactable-th-status');
let tableDOM = $('tbody.reactable-data');
let filtersDOM = $('div.filter-tag-bar');
let refresh = function(){
let count = $('tbody.reactable-data').children().length;
let acCount = $('tbody.reactable-data').find('td[value="ac"]').length;
@nathanielove
nathanielove / hide-href-values-and-enforce-link-colors-for-printing-with-jquery.md
Last active May 8, 2018
Hide href values and enforce link colors for printing with JQuery
View hide-href-values-and-enforce-link-colors-for-printing-with-jquery.md
@nathanielove
nathanielove / ssh-socks-proxy-mac.md
Last active Jul 31, 2019
macOS SSH Proxy on/off
View ssh-socks-proxy-mac.md

How to use SSH Tunneling with Socks proxy on Mac

Disable networksetup sudo password

To prevent networksetup from asking for password in the terminal, add the following line to the bottom of /etc/sudoers, where <username> is the actual username that you are using on your mac.

<username> ALL=(root) NOPASSWD: /usr/sbin/networksetup

Or, if you wish to enter your password each time you need to turn on/off the proxy, just skip this step.

@nathanielove
nathanielove / how-to-fix-whatever-problem-related-to-locale.md
Created Nov 1, 2016
How to fix whatever problem related to Locale
View how-to-fix-whatever-problem-related-to-locale.md
@nathanielove
nathanielove / how-to-setup-shadowsocks-on-your-ubuntu-server.md
Created Nov 1, 2016
How to setup Shadowsocks on your Ubuntu server
View how-to-setup-shadowsocks-on-your-ubuntu-server.md

How to setup Shadowsocks on your Ubuntu server

Your school or company network may block the access to a few specific websites. To solve this problem, I'd highly recommend Shadowsocks, since it is the easiest proxy tool I've ever found, and it's FREE (of course iff you have your own server running).

First, ssh to your server, and make sure you have Python and pip installed. If you have Python but not pip, install it using the following command

$ sudo apt-get install python3-pip
@nathanielove
nathanielove / how-to-setup-your-ubuntu-server-as-an-always-on-torrent-downloader.md
Created Nov 1, 2016
How to setup your Ubuntu server as an always-on torrent downloader
View how-to-setup-your-ubuntu-server-as-an-always-on-torrent-downloader.md

How to setup your Ubuntu server as an always-on torrent downloader

In this tutorial, we are going to install Aria2 on your Ubuntu server, and use Yaaw as the GUI.

First, ssh to your Ubuntu server, and do the following

$ sudo apt-get update
$ sudo apt-get install aria2
View how-to-connect-django-to-remote-mysql.md

How to Connect Django to Remote MySQL

==[ONLY for Ubuntu]== Install libmysqlclient-dev

$ sudo apt-get install libmysqlclient-dev

Install mysqlclient.

@nathanielove
nathanielove / how-to-install-mysql-server-on-ubuntu-and-enable-remote-access.md
Created Nov 1, 2016
How to Install MySQL Server on Ubuntu and Enable Remote Access
View how-to-install-mysql-server-on-ubuntu-and-enable-remote-access.md

How to Install MySQL Server on Ubuntu and Enable Remote Access

Installation

Install MySQL

$ sudo apt-get install mysql-server libapache2-mod-auth-mysql php5-mysql
@nathanielove
nathanielove / result.json
Last active Jan 4, 2017
The Light Bulb Problem
View result.json
{
"off": 60,
"on": 90,
"size": 150
}
You can’t perform that action at this time.