Skip to content

Instantly share code, notes, and snippets.

View cryptoquick's full-sized avatar
🦀
Any application that can be written in Rust, will eventually be written in Rust.

Hunter Beast cryptoquick

🦀
Any application that can be written in Rust, will eventually be written in Rust.
View GitHub Profile
@visnup
visnup / listenOnPortOrSocketFile.js
Last active May 17, 2019 11:57
Listen on a TCP port or a UNIX socket file in node.js. Handle EADDRINUSE for the socket file by deleting it and re-listening.
var fs = require('fs')
, net = require('net')
, http = require('http')
, port = process.env.PORT;
var app = function (req, res) {
res.writeHead(200, {'Content-Type': 'text/plain'});
res.end('Hello World\n');
};
@mixin icon($icon) {
//@extend %icon;
font-family: FontAwesome;
font-weight: normal;
font-style: normal;
display: inline-block;
text-decoration: inherit;
line-height: 1;
content: $icon;
}
@kevinSuttle
kevinSuttle / VS Code settings.json
Last active September 16, 2022 09:44
Visual Studio Code Settings
{
"editor.fontFamily": "Fira Code",
"editor.fontSize": 14,
"editor.formatOnSave": true,
"editor.renderWhitespace": "all",
"editor.tabSize": 2,
"editor.wordWrap": "on",
"flow.useNPMPackagedFlow": true,
"javascript.format.enable": false,
"javascript.validate.enable": false,
@olejon
olejon / Install Spotify 0.9 on Fedora 64-bit
Last active September 17, 2022 08:34
Install Spotify 0.9 on Fedora 64-bit
# NOTES
# Spotify 0.9 vs 1.0 is stable, uses less resources overall and works well with Spotify Connect, SpotCommander, Local Files etc
# Tested and works on Fedora 29 64-bit with GNOME, but should work on previous versions as well
# The sources of the Dropbox files, which are hosted by me and the latest and greatest available, are listed above each one
# No system files will be overwritten by these or used by other programs since they depend on the later Fedora versions
# Make sure you copy the whole lines into Terminal
# Each command is on one line and might be long
# START GUIDE
@jfsiii
jfsiii / fetch-chunked.js
Last active March 30, 2024 01:37
Quick example of using fetch to parse a chunked response
var chunkedUrl = 'https://jigsaw.w3.org/HTTP/ChunkedScript';
fetch(chunkedUrl)
.then(processChunkedResponse)
.then(onChunkedResponseComplete)
.catch(onChunkedResponseError)
;
function onChunkedResponseComplete(result) {
console.log('all done!', result)
}
@heppu
heppu / ARCH_INSTALL.MD
Last active February 27, 2022 17:01
Installing Arch with GPT, dm-crypt, LUKS, LVM and systemd-boot

Create bootable USB

dd bs=4M if=/path/to/archlinux.iso of=/dev/sdx status=progress oflag=sync

Boot from USB and set prepare system

loadkeys <your-keymap>
let yCombinator = f => (g => (...p) => f(g(g))(...p))(g => (...p) => f(g(g))(...p))
var factory = f => (...a) => a.length - a[0].length > 1 ? f.call.call(...a) : f.bind(null, ...a)
//
// we could add some fancy code to eliminate fn.call & fn.bind
//
// var topsy = (f => f.bind(f))(Function.call)
// var turvy = (f => f.bind(f))(Function.bind)
// var factory = f => (...a) => (a.length - a[0].length > 1 ? topsy : turvy(f, null))(...a)
//
@martinthomson
martinthomson / quic_header.md
Last active September 9, 2023 15:21
QUIC header format proposal

There are two forms of QUIC common header: long and short. Long form packets are used for the initial exchange - until both 1-RTT packet protection can be started AND version negotiation is complete. Short form packets carry the bulk of the data.

This removes a lot of the flexibility that was the source of most of the objections to the current format. Fields are aligned on four octet boundaries. All long-form header variations have the exact same form. The connection ID is in the same place in both short and long form. The long form clearly identifies the role of the sender in the first octet and it identifies the

@wmertens
wmertens / router.jsx
Last active August 10, 2017 11:14
Wrapper for react-router v4 with an API more to my tastes
import React, {Component, PropTypes} from 'react'
import {Link, Route as OrigRoute, Switch, Redirect, BrowserRouter as Router, withRouter} from 'react-router-dom'
// Subscribes a child to history updates, passing the current location as a prop
// This is needed to work around the React context API not updating all children
// See https://github.com/ReactTraining/react-router/issues/4629#issuecomment-284218493
export class LocationListener extends Component {
static contextTypes = {
history: PropTypes.object,
}
@jtanx
jtanx / keybindings.json
Created April 23, 2017 09:33
Visual Studio Code disable MRU tab switching
[
{
"key": "ctrl+shift+tab",
"command": "workbench.action.previousEditor"
},
{
"key": "ctrl+tab",
"command": "workbench.action.nextEditor"
}
]