Skip to content

Instantly share code, notes, and snippets.

View stagas's full-sized avatar
🤸

stagas stagas

🤸
View GitHub Profile
#define _GNU_SOURCE
#include <errno.h>
#include <sched.h>
#include <signal.h>
#include <stdio.h>
#include <stdlib.h>
#include <sys/mount.h>
#include <sys/stat.h>
#include <sys/syscall.h>
#include <sys/types.h>

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,

@GabrielMajeri
GabrielMajeri / denormals.md
Last active October 2, 2022 18:49
Enable flushing denormals to zero in Rust

Flushing denormals to zero

Floating-point operations can sometimes result in denormalized numbers or arithmetic underflow. Hardware conforming to IEEE 754 has to support these conditions (albeit with lower performance) to maintain some numerical accuracy.

In certain high-performance applications, it might be beneficial to ignore

FWIW: I (@rondy) am not the creator of the content shared here, which is an excerpt from Edmond Lau's book. I simply copied and pasted it from another location and saved it as a personal note, before it gained popularity on news.ycombinator.com. Unfortunately, I cannot recall the exact origin of the original source, nor was I able to find the author's name, so I am can't provide the appropriate credits.


Effective Engineer - Notes

What's an Effective Engineer?

@rauchg
rauchg / README.md
Last active January 6, 2024 07:19
require-from-twitter
# Hello, and welcome to makefile basics.
#
# You will learn why `make` is so great, and why, despite its "weird" syntax,
# it is actually a highly expressive, efficient, and powerful way to build
# programs.
#
# Once you're done here, go to
# http://www.gnu.org/software/make/manual/make.html
# to learn SOOOO much more.
@LeCoupa
LeCoupa / nodejs-cheatsheet.js
Last active April 19, 2024 01:50
Complete Node.js CheatSheet --> UPDATED VERSION --> https://github.com/LeCoupa/awesome-cheatsheets
/* *******************************************************************************************
* THE UPDATED VERSION IS AVAILABLE AT
* https://github.com/LeCoupa/awesome-cheatsheets
* ******************************************************************************************* */
// 0. Synopsis.
// http://nodejs.org/api/synopsis.html
@speier
speier / 1. on the server
Last active December 19, 2015 13:49
experimenting with git powered deployment
01. `apt-get install git`
02. `adduser git`
03. `visudo` add `git ALL=(ALL:ALL) NOPASSWD: ALL` to user privilege specification
04. `login git`
05. `ssh-keygen -t rsa`
06. `mkdir project`
07. `mkdir project.git`
08. `cd project.git`
09. `git init --bare`
10. `cd hooks`
@willurd
willurd / web-servers.md
Last active April 23, 2024 23:07
Big list of http static server one-liners

Each of these commands will run an ad hoc http static server in your current (or specified) directory, available at http://localhost:8000. Use this power wisely.

Discussion on reddit.

Python 2.x

$ python -m SimpleHTTPServer 8000
@jaygooby
jaygooby / git_notes.md
Last active October 16, 2023 16:26
Git, you bloody git

Overwrite untracked files in current branch from a remote branch

In a similar vein to git reset --hard feature/weavils you can just overwrite untracked working files (typically left over from branch experiments) which are part of the remote branch you're pulling like this:

git reset --hard origin/feature/weavils

Normally, if you tried git checkout feature/weavils you'd get warnings like untracked working tree files would be overwritten by merge, so hit them with the --hard hammer instead.

(Found via https://stackoverflow.com/q/17404316/391826 and one of the answers: https://stackoverflow.com/a/36824493/391826)