Skip to content

Instantly share code, notes, and snippets.

@thoughtsunificator
thoughtsunificator / README.md
Last active April 26, 2024 22:03
Setup a native proxy switcher on Firefox
  • Download script.pac to /home/user/script.pac
  • Go to FF network settings and select 'Automatic proxy configuration URL'
  • Enter file:///home/user/script.pac
  • Enjoy

Note: If you're using SOCKS v5 you might want to also select 'Proxy DNS when using SOCKS v5'

Tested on 116.0.2 (64 bit) Arch Linux

@CharlesGodwin
CharlesGodwin / cloudflare.md
Last active April 29, 2024 12:49
I Don't Need Port Forwarding and Don't Care About CGNAT

I Don't Need Port Forwarding and Don't Care About CGNAT

This was rewritten 2022-11-30

This article is for users that want all these features:

  • To connect to home network from anywhere
  • Can connect without any port forwarding; either by choice or internet provider can't or won't provide access
  • No setup or configuration or installation on client machine
  • No enrolment / registration required
@markerikson
markerikson / render-logic.js
Last active January 1, 2024 06:20
React render function organization
// See https://blog.isquaredsoftware.com/presentations/react-redux-ts-intro-2020-12/#/36 for slides
// My basic render function structure:
function RenderLogicExample({
someBoolean, // 1) Destructure values from `props` object
someList,
}) {
// 2) Declare state values
const [a, setA] = useState(0);
const [b, setB] = useState(0);
@EugeneKay
EugeneKay / README.md
Last active May 17, 2022 17:32
Winode Instructions

NOTE: This Gist concerns the old Linode KVM Beta, NOT the current Manager. Please see linode/docs#501 (comment) for more up-to-date instructions.

You will need:

On the KVM source, run the following to create a VM:

@RubyTuesdayDONO
RubyTuesdayDONO / gist:5006455
Last active March 11, 2022 18:11 — forked from six8/gist:1732686
logic revisions to pass test case
// Dependency resolution, adapted from https://gist.github.com/1232505/f16308bc14966c8d003c2686b1c258ec41303c1f
function resolve(graph) {
var sorted = [], // sorted list of IDs ( returned value )
visited = {}; // hash: id of already visited node => true
// 2. topological sort
Object.keys(graph).forEach(function visit(name, ancestors) {
if (!Array.isArray(ancestors)) ancestors = [];
ancestors.push(name);
visited[name] = true;
anonymous
anonymous / concerning.rb
Created December 18, 2012 18:00
class Module
# We often find ourselves with a medium-sized chunk of behavior that we'd
# like to extract, but only mix in to a single class.
#
# We typically choose to leave the implementation directly in the class,
# perhaps with a comment, because the mental and visual overhead of defining
# a module, making it a Concern, and including it is just too great.
#
#
# Using comments as lightweight modularity:
@marcedwards
marcedwards / high-dpi-media.css
Last active November 19, 2023 12:56
A CSS media query that captures almost all high DPI aware devices.
/* ---------------------------------------------------------- */
/* */
/* A media query that captures: */
/* */
/* - Retina iOS devices */
/* - Retina Macs running Safari */
/* - High DPI Windows PCs running IE 8 and above */
/* - Low DPI Windows PCs running IE, zoomed in */
/* - Low DPI Windows PCs and Macs running Firefox, zoomed in */
/* - Android hdpi devices and above */