Skip to content

Instantly share code, notes, and snippets.

@mohanpedala
mohanpedala / bash_strict_mode.md
Last active October 28, 2025 22:43
set -e, -u, -o, -x pipefail explanation
; A MICRO-MANUAL FOR LISP - NOT THE WHOLE TRUTH, 1978
; John McCarthy, Artificial Intelligence Laboratory, Stanford University
; https://www.ee.ryerson.ca/~elf/pub/misc/micromanualLISP.pdf
; https://github.com/jaseemabid/micromanual
; for CL : Rainer Joswig, joswig@lisp.de
; this version runs in a Common Lisp
@timvisee
timvisee / falsehoods-programming-time-list.md
Last active October 28, 2025 12:56
Falsehoods programmers believe about time, in a single list

Falsehoods programmers believe about time

This is a compiled list of falsehoods programmers tend to believe about working with time.

Don't re-invent a date time library yourself. If you think you understand everything about time, you're probably doing it wrong.

Falsehoods

  • There are always 24 hours in a day.
  • February is always 28 days long.
  • Any 24-hour period will always begin and end in the same day (or week, or month).
@lattner
lattner / TaskConcurrencyManifesto.md
Last active October 27, 2025 08:04
Swift Concurrency Manifesto
@tzmartin
tzmartin / m3u8-to-mp4.md
Last active September 15, 2025 01:45
m3u8 stream to mp4 using ffmpeg

1. Copy m3u8 link

Alt text

2. Run command

echo "Enter m3u8 link:";read link;echo "Enter output filename:";read filename;ffmpeg -i "$link" -bsf:a aac_adtstoasc -vcodec copy -c copy -crf 50 $filename.mp4
@sj26
sj26 / LICENSE.md
Last active August 26, 2025 22:35
Bash retry function

This is free and unencumbered software released into the public domain.

Anyone is free to copy, modify, publish, use, compile, sell, or distribute this software, either in source code form or as a compiled binary, for any purpose, commercial or non-commercial, and by any means.

In jurisdictions that recognize copyright laws, the author or authors of this software dedicate any and all copyright interest in the software to the public domain. We make this dedication for the benefit

@jtilly
jtilly / install-gcc-4.9.3.sh
Last active April 11, 2024 07:28
Install GCC 4.9.3
#!/bin/bash
# this script installs GCC 4.9.3
# to use it navigate to your home directory and type:
# sh install-gcc-4.9.3.sh
# download and install gcc 4.9.3
wget https://ftp.gnu.org/gnu/gcc/gcc-4.9.3/gcc-4.9.3.tar.gz
tar xzf gcc-4.9.3.tar.gz
cd gcc-4.9.3
@mislav
mislav / poor_promise.js
Last active May 21, 2021 21:52
Poor man's Promise is a minimal but complete implementation of Promises/A+ spec.
(function(self){
if (self.Promise) return
// Implements https://promisesaplus.com
function isFunction(fn) {
return typeof fn == 'function'
}
// Values that should never be checked for presence of a `then` method
function simpleValue(fn) {
@paulirish
paulirish / what-forces-layout.md
Last active October 26, 2025 14:01
What forces layout/reflow. The comprehensive list.

What forces layout / reflow

All of the below properties or methods, when requested/called in JavaScript, will trigger the browser to synchronously calculate the style and layout*. This is also called reflow or layout thrashing, and is common performance bottleneck.

Generally, all APIs that synchronously provide layout metrics will trigger forced reflow / layout. Read on for additional cases and details.

Element APIs

Getting box metrics
  • elem.offsetLeft, elem.offsetTop, elem.offsetWidth, elem.offsetHeight, elem.offsetParent
@ssaunier
ssaunier / redis_cloud_heroku_cli.rb
Created August 2, 2015 10:58
Connect to Heroku RedisCloud as `redis-cli`
#!/usr/bin/env ruby
url_matcher = %r{REDISCLOUD_URL:\s*redis://rediscloud:(\w+)@([\w\-.]+):(\d+)}
env_string = `heroku config | grep REDISCLOUD_URL`
env_settings = env_string.split('\n')
match_data = url_matcher.match(env_settings[0])
db = ARGV[0] || 0