Skip to content

Instantly share code, notes, and snippets.

@OrionReed
OrionReed / dom3d.js
Last active May 3, 2024 22:21
3D DOM viewer, copy-paste this into your console to visualise the DOM topographically.
// 3D Dom viewer, copy-paste this into your console to visualise the DOM as a stack of solid blocks.
// You can also minify and save it as a bookmarklet (https://www.freecodecamp.org/news/what-are-bookmarklets/)
(() => {
const SHOW_SIDES = false; // color sides of DOM nodes?
const COLOR_SURFACE = true; // color tops of DOM nodes?
const COLOR_RANDOM = false; // randomise color?
const COLOR_HUE = 190; // hue in HSL (https://hslpicker.com)
const MAX_ROTATION = 180; // set to 360 to rotate all the way round
const THICKNESS = 20; // thickness of layers
const DISTANCE = 10000; // ¯\\_(ツ)_/¯
@adtac
adtac / Dockerfile
Last active April 13, 2024 22:33
#!/usr/bin/env docker run
#!/usr/bin/env -S bash -c "docker run -p 8080:8080 -it --rm \$(docker build --progress plain -f \$0 . 2>&1 | tee /dev/stderr | grep -oP 'sha256:[0-9a-f]*')"
# syntax = docker/dockerfile:1.4.0
FROM node:20
WORKDIR /root
RUN npm install sqlite3
@khalidx
khalidx / node-typescript-esm.md
Last active April 22, 2024 15:40
A Node + TypeScript + ts-node + ESM experience that works.

The experience of using Node.JS with TypeScript, ts-node, and ESM is horrible.

There are countless guides of how to integrate them, but none of them seem to work.

Here's what worked for me.

Just add the following files and run npm run dev. You'll be good to go!

package.json

@sibelius
sibelius / entria.md
Last active April 22, 2021 01:05
Things that you gonna learn at Entria

Most job post are about requirements that you should already know.

We think that you should learn a lot when working for a company.

So here is a list of many things that you are going to learn while working for us (and many more):

  • how to use git to work in a team
  • how to contribute to open source projects
  • how to manage .env files (configurations)
  • local vs staging vs production environments
@gaearon
gaearon / MyResponsiveComponent.js
Created November 1, 2018 10:05
Examples from "Making Sense of React Hooks"
function MyResponsiveComponent() {
const width = useWindowWidth(); // Our custom Hook
return (
<p>Window width is {width}</p>
);
}
@JamoCA
JamoCA / NordVPN-Server-IP-List.txt
Last active March 27, 2024 16:04
NordVPN Server IP List; 2,590 IPs; 2020-02-04T15:31:55Z
103.120.66.35
103.120.66.51
103.227.255.101
103.60.9.27
103.60.9.75
103.62.49.193
103.62.49.195
103.62.49.198
103.62.49.203
103.62.49.205
const fs = require('fs');
const readline = require('readline');
const rl = readline.createInterface({
input: process.stdin,
output: process.stdout,
terminal: false
});
const paths = [
{ path: 'graphql/connection/', tag: 'Connection' },
@KushalP
KushalP / redis.yml
Created September 27, 2017 15:49
Example of how to set up a redis cluster in kubernetes. To apply: `kubectl create -f redis.yml` Raw
---
apiVersion: v1
kind: ConfigMap
metadata:
name: redis-cluster
labels:
app: redis-cluster
data:
redis.conf: |+
cluster-enabled yes
@sibelius
sibelius / RelayModernUtils.js
Created June 14, 2017 20:09
Relay Modern Utils to reduce QueryRenderer boilerplate
// @flow
import React from 'react';
import hoistStatics from 'hoist-non-react-statics';
import RelayStore from './RelayStore';
import ErrorView from './components/common/Error';
import LoadingView from './components/common/LoadingView';
import type {
Environment,
ClassicEnvironment,
package main
import (
"encoding/json"
"fmt"
"io/ioutil"
"net/http"
"os"
"strconv"
"strings"