Skip to content

Instantly share code, notes, and snippets.

Avatar

Masanori Ogino omasanori

  • Japan, or anywhere else
  • 07:32 (UTC +09:00)
View GitHub Profile
@martijnvermaat
martijnvermaat / nixos.md
Last active June 8, 2023 18:00
Installation of NixOS with encrypted root
View nixos.md
@DraTeots
DraTeots / ComPort over Network.md
Last active June 8, 2023 00:52
ComPort over Network
View ComPort over Network.md
@shafik
shafik / WhatIsStrictAliasingAndWhyDoWeCare.md
Last active June 6, 2023 21:09
What is Strict Aliasing and Why do we Care?
View WhatIsStrictAliasingAndWhyDoWeCare.md

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

@MawKKe
MawKKe / cryptsetup-with-luks2-and-integrity-demo.sh
Last active May 31, 2023 22:28
dm-crypt + dm-integrity + dm-raid = awesome!
View cryptsetup-with-luks2-and-integrity-demo.sh
#!/usr/bin/env bash
#
# Author: Markus (MawKKe) ekkwam@gmail.com
# Date: 2018-03-19
#
#
# What?
#
# Linux dm-crypt + dm-integrity + dm-raid (RAID1)
#
@JamieMason
JamieMason / unfollow.js
Last active May 28, 2023 12:36
Unfollow everyone on twitter.com
View unfollow.js
// Unfollow everyone on twitter.com, by Jamie Mason (https://twitter.com/fold_left)
// https://gist.github.com/JamieMason/7580315
//
// 1. Go to https://twitter.com/YOUR_USER_NAME/following
// 2. Open the Developer Console. (COMMAND+ALT+I on Mac)
// 3. Paste this into the Developer Console and run it
//
// Last Updated: 09 April 2020
(() => {
const $followButtons = '[data-testid$="-unfollow"]';
@pbrisbin
pbrisbin / headache.md
Created October 27, 2014 18:55
ZSH startup file headaches
View headache.md

Default behavior dictates the following order for ZSH startup files:

  • /etc/zshenv
  • ~/.zshenv
  • /etc/zprofile (if login shell)
  • ~/.zprofile (if login shell)
  • /etc/zshrc (if interactive)
  • ~/.zshrc (if interactive)
  • /etc/zlogin (if login shell)
  • ~/.zlogin (if login shell)
@voluntas
voluntas / webrtc.rst
Last active May 25, 2023 16:31
WebRTC コトハジメ
View webrtc.rst
@kayceesrk
kayceesrk / ocaml-native.md
Last active March 28, 2023 06:19
OCaml native code notes
View ocaml-native.md

Concurrency primitives

Signature

(* raw continuation *)
type ('a,'b) stack
perform  : 'a eff -> 'a
resume   : ('a,'b) stack -> ('c -> 'a) -> 'c -> 'b
delegate : 'a eff -> ('a,'b) stack -> 'b
@dherman
dherman / ssa-cps-anf.txt
Created November 20, 2012 03:10
links on SSA, CPS, and A-normal form
View ssa-cps-anf.txt
Original paper on A-normal form:
http://redlinernotes.com/docs/Classics/The%20Essence%20of%20Compiling%20with%20Continuations.pdf
A high-level intro to ANF:
http://matt.might.net/articles/a-normalization/
One of the earlier attempts to relate SSA and CPS:
@jgamblin
jgamblin / commonssids.txt
Created November 28, 2016 02:00
5000 most of common SSID names from https://wigle.net/stats#ssidstats
View commonssids.txt
ssid
xfinitywifi
linksys
<no ssid>
BTWiFi-with-FON
NETGEAR
Ziggo
dlink
BTWifi-X
default