Skip to content

Instantly share code, notes, and snippets.

@krisbolton
krisbolton / fix-USB-showing-up-as-two-partitions.md
Last active March 29, 2024 06:39
How to fix a USB drive showing up as two drives (fragmented into multiple partitions) on Windows

How to fix a USB drive showing up as two drives (fragmented into multiple partitions) on Windows:

  1. Hold the Windows key and press X, select PowerShell (Admin), select Yes to the pop-up. You can also use Command Prompt.
  2. In the Powershell interface type diskpart to enter the disk partition tool.
  3. Type list disk to see all disks listed.
  4. Select the USB drive by typing select disk [NUMBER]. Be careful to select the correct drive.
  5. Type clean. An error will occur if you have the drive folder open, close the window and repeat the command if this happens.
  6. Type create partition primary.
  7. Type format fs=ntfs quick to format the drive (you can also choose to set fs=fat32).
  8. Type active.
@johnz133
johnz133 / elon_musk_use_commencement_speech_transcript
Last active March 29, 2024 06:37
Elon Musk USC Commencement Speech Transcript.
Alright, thank you.
So, I’ve got about apparently I’ve got about five to six minutes to say the most useful things I can think of.
I’m gonna do my best.
It was suggested that I distill things down to 3 items.
I think I’ll go with four.
And I’ll try, I think, I think these are pretty important ones.
Some of it may kinda sound like, well you’ve heard them before.
But, you know, worth reemphasizing.
I think the first is, you need to work, if you, depending on how well you want to do,
@endrsmar
endrsmar / index.ts
Created January 9, 2024 12:11
Raydium new pool listener
import { LiquidityPoolKeysV4, MARKET_STATE_LAYOUT_V3, Market, TOKEN_PROGRAM_ID } from "@raydium-io/raydium-sdk";
import { Connection, Logs, ParsedInnerInstruction, ParsedInstruction, ParsedTransactionWithMeta, PartiallyDecodedInstruction, PublicKey } from "@solana/web3.js";
const RPC_ENDPOINT = 'https://api.mainnet-beta.solana.com';
const RAYDIUM_POOL_V4_PROGRAM_ID = '675kPX9MHTjS2zt1qfr1NYHuzeLXfQM9H24wFSUt1Mp8';
const SERUM_OPENBOOK_PROGRAM_ID = 'srmqPvymJeFKQ4zGQed1GFppgkRHL9kaELCbyksJtPX';
const SOL_MINT = 'So11111111111111111111111111111111111111112';
const SOL_DECIMALS = 9;
const connection = new Connection(RPC_ENDPOINT);

Laravel alternatives in NodeJS

These are alternative packages/frameworks in NodeJS that cover some of the primary features in Laravel. This is by no means a comprehensive list of Laravel features (or a comprehensive list of NodeJS alternatives).

Depending on your perspective, this list either shows how it's possible to switch from Laravel to NodeJS or shows why you'd want to stay with Laravel 😃


Full stack framework alternatives: Nest, Adonis

@bpsib
bpsib / BBC-Radio-HLS.m3u
Last active March 29, 2024 06:37 — forked from stengland/BBC-Radio.m3u
BBC Radio Streams
#EXTM3U
#EXTINF:-1,BBC - Radio 1
http://as-hls-ww-live.akamaized.net/pool_904/live/ww/bbc_radio_one/bbc_radio_one.isml/bbc_radio_one-audio%3d96000.norewind.m3u8
#EXTINF:-1,BBC - Radio 1Xtra
http://as-hls-ww-live.akamaized.net/pool_904/live/ww/bbc_1xtra/bbc_1xtra.isml/bbc_1xtra-audio%3d96000.norewind.m3u8
#EXTINF:-1,BBC - Radio 1Dance
http://as-hls-ww-live.akamaized.net/pool_904/live/ww/bbc_radio_one_dance/bbc_radio_one_dance.isml/bbc_radio_one_dance-audio%3d96000.norewind.m3u8
#EXTINF:-1,BBC - Radio 1Relax
http://as-hls-ww-live.akamaized.net/pool_904/live/ww/bbc_radio_one_relax/bbc_radio_one_relax.isml/bbc_radio_one_relax-audio%3d96000.norewind.m3u8
#EXTINF:-1,BBC - Radio 2
@tykurtz
tykurtz / grokking_to_leetcode.md
Last active March 29, 2024 06:27
Grokking the coding interview equivalent leetcode problems

GROKKING NOTES

I liked the way Grokking the coding interview organized problems into learnable patterns. However, the course is expensive and the majority of the time the problems are copy-pasted from leetcode. As the explanations on leetcode are usually just as good, the course really boils down to being a glorified curated list of leetcode problems.

So below I made a list of leetcode problems that are as close to grokking problems as possible.

Pattern: Sliding Window

@vasanthk
vasanthk / System Design.md
Last active March 29, 2024 06:27
System Design Cheatsheet

System Design Cheatsheet

Picking the right architecture = Picking the right battles + Managing trade-offs

Basic Steps

  1. Clarify and agree on the scope of the system
  • User cases (description of sequences of events that, taken together, lead to a system doing something useful)
    • Who is going to use it?
    • How are they going to use it?
@cassidoo
cassidoo / base-css.md
Created May 4, 2022 06:37
Base CSS for a plain HTML document

If you don't want to deal with styling a mostly text-based HTML document, plop these lines in and it'll look good:

html {
  font-family: 'Helvetica Neue', 'Helvetica', 'Arial', sans-serif;
  font-size: 1.3em;
  max-width: 40rem;
  padding: 2rem;
  margin: auto;
 line-height: 1.5rem;
@bennlee
bennlee / fix-input-source-switching-delay-in-m1-macbook.md
Last active March 29, 2024 06:23
M1 맥에서 한영키 전환 딜레이 해결하기

M1 맥북에서 한영키 전환 딜레이 해결하기

맥에서 Caps Lock을 한/영 전환키로 사용하면서부터 딜레이가 생기거나, 제대로 바뀌지 않는 고질적인 문제가 꾸준히 발생해왔다. 대소문자를 고정하는 Caps Lock기능과 한/영 전환 기능을 누른 시간에 기반하여 구분하는 과정에서 생긴 문제로 추정되지만, Caps Lock기능을 해제해도 여전히 문제가 발생한다. 이에 사용자들은 karabiner-elements등의 편법을 통해 Caps Lock키를 실제로 사용하지 않는 F18등의 키로 매핑하여 해결해 왔다.

하지만, Apple Silicon을 탑재한 기기들에서는 다음과 같은 문제가 있다.

  • karabiner-elements가 제대로 지원되지 않는 이슈가 있어 hammerspoon등의 차선책을 사용해야한다.
  • M1 이전까지의 맥과는 다르게 키매핑만으로 문제가 완전히 해결되지 않는다.
@OrionReed
OrionReed / DOM3D.js
Last active March 29, 2024 06:22
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; // ¯\\_(ツ)_/¯