Skip to content

Instantly share code, notes, and snippets.

🌴
On vacation

Jewel Mahanta lap00zza

🌴
On vacation
Block or report user

Report or block lap00zza

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
@lap00zza
lap00zza / scrapper.js
Last active Oct 16, 2017
Scrape anime info from MAL
View scrapper.js
const h2 = document.querySelectorAll("h2");
const infoH2 = (() => {
for (let i = 0; i < h2.length; i++) {
if (h2[i].innerText === "Information") return h2[i];
}
})();
// holds the elements between the Information (H2) and the next H2
const elList = [];
// start from the element after the H2
let now = infoH2.nextElementSibling;
View lapzbotAPI.py
# coding=utf-8
"""
LAPZBOT Restful
Handles the inter process communications between Lapzbot and the Console, without having to rely on the database
for Server / User information. This is intended to be run in a thread.
Typical UseCase:
----------------
import lapzbotAPI
@cecilemuller
cecilemuller / letsencrypt_2019.md
Last active Dec 5, 2019
How to setup Let's Encrypt for Nginx on Ubuntu 18.04 (including IPv6, HTTP/2 and A+ SSL rating)
View letsencrypt_2019.md

How to setup Let's Encrypt for Nginx on Ubuntu 18.04 (including IPv6, HTTP/2 and A+ SLL rating)


Virtual hosts

Let's say you want to host domains first.com and second.com.

Create folders for their files:

@joepie91
joepie91 / vpn.md
Last active Dec 6, 2019
Don't use VPN services.
View vpn.md

Don't use VPN services.

No, seriously, don't. You're probably reading this because you've asked what VPN service to use, and this is the answer.

Note: The content in this post does not apply to using VPN for their intended purpose; that is, as a virtual private (internal) network. It only applies to using it as a glorified proxy, which is what every third-party "VPN provider" does.

A Russian translation of this article can be found here, contributed by Timur Demin. There's also this article about VPN services, which is honestly better written (and has more cat pictures!) than my article.

Why not?

@CMCDragonkai
CMCDragonkai / http_streaming.md
Last active Dec 3, 2019
HTTP Streaming (or Chunked vs Store & Forward)
View http_streaming.md

HTTP Streaming (or Chunked vs Store & Forward)

The standard way of understanding the HTTP protocol is via the request reply pattern. Each HTTP transaction consists of a finitely bounded HTTP request and a finitely bounded HTTP response.

However it's also possible for both parts of an HTTP 1.1 transaction to stream their possibly infinitely bounded data. The advantages is that the sender can send data that is beyond the sender's memory limit, and the receiver can act on

@nickautomatic
nickautomatic / cmder.md
Last active Dec 6, 2019
Setting up Cmder to use bash by default
View cmder.md

Set up cmder to use msysgit / bash by default

  • Install cmder_mini (msysgit is already installed, so no need for full version)
  • In Cmder, open settings: Win + Alt + P
  • Under Startup > Tasks, add a task called {bash} with the following settings:
    • Task parameters (set icon):
      • For Cmder icon: /icon "%CMDER_ROOT%\cmder.exe"
      • For Git icon: /icon "C:\Program Files (x86)\Git\etc\git.ico"
    • Commands (open Git's bash shell):
      • "C:\Program Files (x86)\Git\bin\sh.exe" -l -new_console:d:%USERPROFILE%
View exponentialBackoff.js
var attempts = 1;
function createWebSocket () {
var connection = new WebSocket();
connection.onopen = function () {
// reset the tries back to 1 since we have a new connection opened.
attempts = 1;
// ...Your app's logic...
@kentbrew
kentbrew / node-on-ec2-port-80.md
Last active Jul 21, 2019
How I Got Node.js Talking on EC2's Port 80
View node-on-ec2-port-80.md

The Problem

Standard practices say no non-root process gets to talk to the Internet on a port less than 1024. How, then, could I get Node talking on port 80 on EC2? (I wanted it to go as fast as possible and use the smallest possible share of my teeny tiny little micro-instance's resources, so proxying through nginx or Apache seemed suboptimal.)

The temptingly easy but ultimately wrong solution:

Alter the port the script talks to from 8000 to 80:

}).listen(80);
You can’t perform that action at this time.