Skip to content

Instantly share code, notes, and snippets.

View siberex's full-sized avatar
🛠️
Your stack will not be full without me

Stephen Jingle siberex

🛠️
Your stack will not be full without me
View GitHub Profile
@Prottoy2938
Prottoy2938 / Dijkstra's-algorithm.js
Created March 18, 2020 10:02
Dijkstra's algorithm implementation in JavaScript
//Dijkstra algorithm is used to find the shortest distance between two nodes inside a valid weighted graph. Often used in Google Maps, Network Router etc.
//helper class for PriorityQueue
class Node {
constructor(val, priority) {
this.val = val;
this.priority = priority;
}
}
@IanColdwater
IanColdwater / twittermute.txt
Last active August 18, 2025 07:02
Here are some terms to mute on Twitter to clean your timeline up a bit.
Mute these words in your settings here: https://twitter.com/settings/muted_keywords
ActivityTweet
generic_activity_highlights
generic_activity_momentsbreaking
RankedOrganicTweet
suggest_activity
suggest_activity_feed
suggest_activity_highlights
suggest_activity_tweet
@siberex
siberex / !oh-my-zsh-macos.md
Last active September 3, 2020 16:47
Oh-My-Zsh MacOs setup

How to setup a practically free CDN using Backblaze B2 and Cloudflare

⚠️ Note 2023-01-21
Some things have changed since I originally wrote this in 2016. I have updated a few minor details, and the advice is still broadly the same, but there are some new Cloudflare features you can (and should) take advantage of. In particular, pay attention to Trevor Stevens' comment here from 22 January 2022, and Matt Stenson's useful caching advice. In addition, Backblaze, with whom Cloudflare are a Bandwidth Alliance partner, have published their own guide detailing how to use Cloudflare's Web Workers to cache content from B2 private buckets. That is worth reading,

@fnky
fnky / ANSI.md
Last active October 16, 2025 22:02
ANSI Escape Codes

ANSI Escape Sequences

Standard escape codes are prefixed with Escape:

  • Ctrl-Key: ^[
  • Octal: \033
  • Unicode: \u001b
  • Hexadecimal: \x1B
  • Decimal: 27
@VGoshev
VGoshev / Dockerfile
Created November 1, 2018 14:08
Test for Oleg
FROM ubuntu
COPY entry.sh cmd.sh /
ENTRYPOINT ["/entry.sh"]
CMD ["/cmd.sh", "ololo"]
@siberex
siberex / range.js
Last active August 21, 2025 16:37
JS range Python-style
function* range(start, end, skip = 1) {
if (!end) {end = start; start = 1}
while (start <= end) {
yield start;
start += skip
}
}
console.log( [...range(7)] );
// [ 1, 2, 3, 4, 5, 6, 7 ]
#!/bin/sh
filter='subsystem contains "com.apple.TimeMachine"'
log show --style syslog --info --last 12h --predicate "$filter"
log stream --style syslog --info --predicate "$filter"
@mutin-sa
mutin-sa / Top_Public_Time_Servers.md
Last active October 12, 2025 12:24
List of Top Public Time Servers

Google Public NTP [AS15169]:

time.google.com

time1.google.com

time2.google.com

time3.google.com

@shafik
shafik / WhatIsStrictAliasingAndWhyDoWeCare.md
Last active October 15, 2025 20:35
What is Strict Aliasing and Why do we Care?

What is the Strict Aliasing Rule and Why do we care?

(OR Type Punning, Undefined Behavior and Alignment, Oh My!)

What is strict aliasing? First we will describe what is aliasing and then we can learn what being strict about it means.

In C and C++ aliasing has to do with what expression types we are allowed to access stored values through. In both C and C++ the standard specifies which expression types are allowed to alias which types. The compiler and optimizer are allowed to assume we follow the aliasing rules strictly, hence the term strict aliasing rule. If we attempt to access a value using a type not allowed it is classified as undefined behavior(UB). Once we have undefined behavior all bets are off, the results of our program are no longer reliable.

Unfortunately with strict aliasing violations, we will often obtain the results we expect, leaving the possibility the a future version of a compiler with a new optimization will break code we th