Skip to content

Instantly share code, notes, and snippets.

View noscripter's full-sized avatar
✌️
Peace and love.

NoScripter noscripter

✌️
Peace and love.
View GitHub Profile
@noscripter
noscripter / remoteDebugging.md
Created April 18, 2022 06:22 — forked from royshouvik/remoteDebugging.md
Describes how to setup remote debugging on an Android device using Chrome

Remote Debugging on Android with Chrome

The way your web content behaves on mobile can be dramatically different from the desktop experience. Remote debugging with Chrome DevTools lets you debug live content on your Android device from your development machine.

Debugging Chrome for Android using the Chrome Developer Tools

Remote debugging on Android supports:

  • Debugging websites in browser tabs.
  • Debugging WebViews in native Android apps.
@noscripter
noscripter / website-dl.md
Created October 20, 2021 08:44 — forked from stvhwrd/website-dl.md
Download an entire website for offline use with wget. Internal inks will be corrected so that the entire downloaded site will work as it did online.

The best way to download a website for offline use, using wget

There are two ways - the first way is just one command run plainly in front of you; the second one runs in the background and in a different instance so you can get out of your ssh session and it will continue.

First make a folder to download the websites to and begin your downloading: (note if downloading www.SOME_WEBSITE.com, you will get a folder like this: /websitedl/www.SOME_WEBSITE.com/)


STEP 1:

@noscripter
noscripter / wget.sh
Created October 20, 2021 08:44 — forked from crittermike/wget.sh
Download an entire website with wget, along with assets.
# One liner
wget --recursive --page-requisites --adjust-extension --span-hosts --convert-links --restrict-file-names=windows --domains yoursite.com --no-parent yoursite.com
# Explained
wget \
--recursive \ # Download the whole site.
--page-requisites \ # Get all assets/elements (CSS/JS/images).
--adjust-extension \ # Save files with .html on the end.
--span-hosts \ # Include necessary assets from offsite as well.
--convert-links \ # Update links to still work in the static version.
@noscripter
noscripter / firefox-viewsource-customize.md
Created October 11, 2021 02:59 — forked from abelcheung/firefox-viewsource-customize.md
Customizing Firefox view-source style -- Solarized Dark theme with wallpaper

Customizing Firefox view-source style

TL;DR

  1. Open (or create) chrome/userContent.css under your Firefox profile folder
  2. Append attached CSS content and save file
  3. Restart Firefox

firefox view-source style customization

@noscripter
noscripter / cpu-intensive.js
Created September 28, 2021 06:40 — forked from sorenlouv/cpu-intensive.js
A CPU intensive operation. Use to test imitate blocking code, test WebWorkers etc.
function mySlowFunction(baseNumber) {
console.time('mySlowFunction');
let result = 0;
for (var i = Math.pow(baseNumber, 7); i >= 0; i--) {
result += Math.atan(i) * Math.tan(i);
};
console.timeEnd('mySlowFunction');
}
mySlowFunction(8); // higher number => more iterations => slower
@noscripter
noscripter / compress-pdf-with-gs.md
Created March 24, 2021 10:44 — forked from guifromrio/compress-pdf-with-gs.md
Compress PDF files with ghostscript

This can reduce files to ~15% of their size (2.3M to 345K, in one case) with no obvious degradation of quality.

ghostscript -sDEVICE=pdfwrite -dCompatibilityLevel=1.4 -dPDFSETTINGS=/printer -dNOPAUSE -dQUIET -dBATCH -sOutputFile=output.pdf input.pdf

Other options for PDFSETTINGS:

  • /screen selects low-resolution output similar to the Acrobat Distiller "Screen Optimized" setting.
  • /ebook selects medium-resolution output similar to the Acrobat Distiller "eBook" setting.
  • /printer selects output similar to the Acrobat Distiller "Print Optimized" setting.
  • /prepress selects output similar to Acrobat Distiller "Prepress Optimized" setting.
@noscripter
noscripter / vanilla-js-cheatsheet.md
Created March 4, 2020 14:33 — forked from thegitfather/vanilla-js-cheatsheet.md
Vanilla JavaScript Quick Reference / Cheatsheet
@noscripter
noscripter / web-servers.md
Created August 5, 2019 09:41 — forked from willurd/web-servers.md
Big list of http static server one-liners

Each of these commands will run an ad hoc http static server in your current (or specified) directory, available at http://localhost:8000. Use this power wisely.

Discussion on reddit.

Python 2.x

$ python -m SimpleHTTPServer 8000