Skip to content

Instantly share code, notes, and snippets.

View Hum4n01d's full-sized avatar
hey :)

Kent Hum4n01d

hey :)
View GitHub Profile
gullyn / flappy.html
Last active May 4, 2024 15:35
Flappy bird in 205 bytes (improved!)
<body onload=z=c.getContext`2d`,setInterval(`c.width=W=150,Y<W&&P<Y&Y<P+E|9<p?z.fillText(S++${Y=`,9,9|z.fillRect(p`}*0,Y-=--M${Y+Y},P+E,9,W),P))):p=M=Y=S=6,p=p-6||(P=S%E,W)`,E=49) onclick=M=9><canvas id=c>
dajo / quizlet-scraper.js
Last active April 23, 2023 11:01 — forked from nodaguti/quizlet-scraper.js
Quizlet to CSV
* Convert a list on Quizlet into CSV-formatted text.
* Usage:
* i) Copy and paste into your browser's console.
* ii) Run it!
(() => {
const terms = document.getElementsByClassName('term');
const csv = [];
timvisee /
Last active June 17, 2024 07:15
Falsehoods programmers believe about time, in a single list

Falsehoods programmers believe about time

This is a compiled list of falsehoods programmers tend to believe about working with time.

Don't re-invent a date time library yourself. If you think you understand everything about time, you're probably doing it wrong.


  • There are always 24 hours in a day.
  • February is always 28 days long.
  • Any 24-hour period will always begin and end in the same day (or week, or month).
import UIKit
class ViewController: UIViewController, UITableViewDelegate, UITableViewDataSource {
@IBOutlet weak var tableView: UITableView!
override func viewDidLoad() {
tableView.topAnchor.constraint(equalTo: view.topAnchor),
slavafomin /
Last active May 17, 2018 08:50
npm 5 vs yarn

npm 5 vs yarn

Looks like npm decided to stand up to yarn by releasing npm version 5, which is announced to be 5 times faster than previous version of npm.

I've decided to test it in one of my projects, the results are below:

Performance Benchmark

eddywashere / App.js
Last active February 20, 2020 10:15 — forked from gaearon/App.js
Reactstrap App.js Example for create-react-app
import React, { Component } from 'react';
import {
msuchodolski / electron_drag_disable.css
Last active July 19, 2023 13:08
Disable dragging and selecting html elements (like links, images etc...) in Electron
* * Prevent dragging all HTML elements, specially:
* - images
* - links (anchors)
* * Prevent text selection
lava /
Last active March 2, 2024 17:22
Hello, world: Deep analysis of a shallow program.

Hello, world!

Please explain in detail what will happen if the following program is executed:

#include <iostream>

int main() {
    std::cout << "Hello, world!" << std::endl;

How you can help reduce node_modules bloat

This recent reddit thread reveals discontent among the web development community about the sheer volume of stuff in a typical node_modules dir. 140MB in this case!

Is it a design flaw in npm?

Opinions in the thread varied from "I'm surprised npm even works" to "everything is fine". I'm not going to offer an opinion, just these two observations:

  1. node_modules dirs typically do contain lots of stuff that doesn't need to be there.
  2. The latest version mitigates overall size by flattening the dependency tree, but some of the bloat is beyond npm's control.
gruber / Liberal Regex Pattern for Web URLs
Last active April 22, 2024 19:02
Liberal, Accurate Regex Pattern for Matching Web URLs
The regex patterns in this gist are intended only to match web URLs -- http,
https, and naked domains like "". For a pattern that attempts to
match all URLs, regardless of protocol, see:
# Single-line version: