Skip to content

Instantly share code, notes, and snippets.

@shafik
shafik / WhatIsStrictAliasingAndWhyDoWeCare.md
Last active March 24, 2025 01:01
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

create-react-app $APP_NAME
cd $APP_NAME
git init
heroku create $APP_NAME --buildpack https://github.com/mars/create-react-app-buildpack.git
git add .
git commit -m "Start with create-react-app"
git push heroku master
heroku open
Sanshiro Sugata (1943)
The Most Beautiful (1944)
Sanshiro Sugata Part Two (1945)
The Men Who Tread on the Tiger's Tail (1945)
No Regrets for Our Youth (1946)
One Wonderful Sunday (1947)
Drunken Angel (1948)
Stray Dog (1949)
Scandal (1950)
Rashomon (1950)
@baio
baio / F#
Last active April 25, 2017 03:17
ramda vs F#
#r "node_modules/fable-core/Fable.Core.dll"
open Fable.Core
// Grid abstarct (Middle Layer)
type GridLineTypes =
| None = 0
| Solid = 1
@avafloww
avafloww / PhpJava.java
Last active April 1, 2025 18:01
This snippet of code is syntactically valid in both PHP and Java, and produces the same output in both.
/*<?php
//*/public class PhpJava { public static void main(String[] args) { System.out.printf("/*%s",
//\u000A\u002F\u002A
class PhpJava {
static function main() {
echo(//\u000A\u002A\u002F
"Hello World!");
}}
//\u000A\u002F\u002A
PhpJava::main();
@mmazzarolo
mmazzarolo / Appfile
Created May 17, 2016 11:27
Simple Fastlane setup for React-Native (Android - iOS)
# iOS
app_identifier "com.myapp.app" # The bundle identifier of your app
apple_id "[email protected]" # Your Apple email address
team_id "1234ABCD" # Developer Portal Team ID
# Android
json_key_file "./google-play-api-secret.json" # Path to the json secret file - Follow https://github.com/fastlane/supply#setup to get one
package_name "com.myapp.app" # Your Android app package
@shadda
shadda / Dockerfile
Created October 1, 2015 20:41 — forked from kvncrw/Dockerfile
PHP5.6 latest FPM with Laravel 5.* deps and some stupid pecl stuff
FROM php:5.6-fpm
# compile + install xdebug
RUN curl -SL "http://xdebug.org/files/xdebug-2.3.3.tgz" -o xdebug.tar.xz \
&& mkdir -p /usr/src/xdebug \
&& tar -xof xdebug.tar.xz -C /usr/src/xdebug --strip-components=1 \
&& rm xdebug.tar.xz \
&& cd /usr/src/xdebug \
&& phpize \
&& ./configure \
@omnibs
omnibs / phoenix showdown rackspace onmetal io.md
Last active June 10, 2024 17:47
Phoenix Showdown Comparative Benchmarks @ Rackspace

Comparative Benchmark Numbers @ Rackspace

I've taken the benchmarks from Matthew Rothenberg's phoenix-showdown, updated Phoenix to 0.13.1 and ran the tests on the most powerful machines available at Rackspace.

Results

Framework Throughput (req/s) Latency (ms) Consistency (σ ms)
@treed
treed / gist:0c60029b53b4fc193181
Created October 4, 2014 09:39
Add go type to airline next to tagbar
call airline#parts#define_function('goinfo', 'go#complete#GetInfo')
call airline#parts#define_condition('goinfo', '&ft =~ "go"')
function! AirlineInit()
" Ended up not having virtualenv here since for some reason it insisted on having that as a bare string
let g:airline_section_x = airline#section#create_right(['goinfo', 'tagbar', 'filetype'])
endfunction
autocmd VimEnter * call AirlineInit()
@LinusU
LinusU / README.md
Last active July 17, 2021 08:06 — forked from apla/icons_and_splash.js
Icons and Splash images for your Cordova project. (with iOS 7 support)

Usage

Install cordova into node_modules

npm install cordova

Add icons_and_splash.js