Skip to content

Instantly share code, notes, and snippets.

View SharkFourSix's full-sized avatar
💭
I may be slow to respond.

SharkFourSix

💭
I may be slow to respond.
View GitHub Profile
@OrionReed
OrionReed / dom3d.js
Last active April 18, 2025 08:15
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; // ¯\\_(ツ)_/¯
package main
import (
"fmt"
"io/ioutil"
"net/http"
"sync"
"time"
"go.uber.org/ratelimit"
@SharkFourSix
SharkFourSix / UrlUtil.java
Created August 11, 2021 15:04
URL Query Parameter Manipulator: Add/Remove Query Parameters
import java.net.MalformedURLException;
import java.net.URL;
import java.util.*;
public class UrlUtil {
private final URL url;
private final Map<String, List<String>> parameters;
public UrlUtil(String url) throws MalformedURLException {
this.url = new URL(url);
@fernandoaleman
fernandoaleman / install-rabbitmq-centos-7.md
Last active December 12, 2024 12:38
Install RabbitMQ on CentOS 7

Install RabbitMQ on CentOS 7

sudo yum -y install epel-release
sudo yum -y update

Install Erlang

Download repository

@ezhov-da
ezhov-da / java-Spark download random file.java
Last active June 7, 2021 12:48
java spark download random file
get("/file", ((request, response) -> {
response.header("Content-disposition", "attachment; filename=file.txt;");
File file = new File("E:\\_file-test.txt");
OutputStream outputStream = response.raw().getOutputStream();
outputStream.write(Files.readAllBytes(file.toPath()));
outputStream.flush();
return response;
}));
@nelaaro
nelaaro / gist:9ac6fee4e8fdac9ee8fdd25aeb5456f8
Last active February 1, 2022 08:59
12d1:14dc Huawei Technologies Co., Ltd. E33372 LTE/UMTS/GSM HiLink Modem/Networkcard, Huawei Technologies Co., Ltd. E353/E3131 (Mass storage mode)
sudo usb_modeswitch -v 12d1 -p 1f01 -V 12d1 -P 14DC -J
# Bus 001 Device 028: ID 12d1:14dc Huawei Technologies Co., Ltd. E33372 LTE/UMTS/GSM HiLink Modem/Networkcard
# Bus 001 Device 027: ID 12d1:1f01 Huawei Technologies Co., Ltd. E353/E3131 (Mass storage mode)
sudo usb_modeswitch -h 15s  Thu 23 Nov 2017 00:13:05 SAST
* usb_modeswitch: handle USB devices with multiple modes
* Version 2.5.1 (C) Josua Dietze 2017
* Based on libusb1/libusbx
@Kalimaha
Kalimaha / proxy.py
Last active August 2, 2024 05:15
Simple Proxy server in Python
import time
from threading import Thread
try:
import socketserver as SocketServer
import http.server as SimpleHTTPServer
except ImportError:
import SocketServer
import SimpleHTTPServer
@tayvano
tayvano / gist:6e2d456a9897f55025e25035478a3a50
Created February 19, 2017 05:29
complete list of ffmpeg flags / commands
Originall From: Posted 2015-05-29 http://ubwg.net/b/full-list-of-ffmpeg-flags-and-options
This is the complete list that’s outputted by ffmpeg when running ffmpeg -h full.
usage: ffmpeg [options] [[infile options] -i infile]… {[outfile options] outfile}…
Getting help:
-h — print basic options
-h long — print more options
-h full — print all options (including all format and codec specific options, very long)
@timsavage
timsavage / websocket_server.py
Last active June 27, 2023 16:58
Simple example of a websocket server with Tornado
# While this code still works, I would recommend using Fast API for websockets in modern applications.
# See: https://fastapi.tiangolo.com/advanced/websockets/
# Note this is targeted at python 3
import tornado.web
import tornado.httpserver
import tornado.ioloop
import tornado.websocket
import tornado.options
@mikeapr4
mikeapr4 / CertificateUtils.java
Created February 12, 2016 15:48
Convenient In-Memory Self-signed Certificate and Keystore creation for Java 8
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import sun.security.tools.keytool.CertAndKeyGen;
import sun.security.x509.X500Name;
import java.io.IOException;
import java.security.InvalidKeyException;
import java.security.KeyStore;
import java.security.KeyStoreException;
import java.security.NoSuchAlgorithmException;