Skip to content

Instantly share code, notes, and snippets.

@oblitum
oblitum / compile-time-primes-2.cpp
Last active May 7, 2018 18:20
compile time primes
// compiled on Ubuntu 13.04 with:
// clang++ -O3 -ftemplate-depth-8192 -fconstexpr-depth=4096 -std=c++11 -stdlib=libc++ -lcxxrt -ldl compile-time-primes-2.cpp -o compile-time-primes-2
// assembly output with:
// clang++ -S -mllvm --x86-asm-syntax=intel -O3 -ftemplate-depth-8192 -fconstexpr-depth=4096 -std=c++11 -stdlib=libc++ -lcxxrt -ldl compile-time-primes-2.cpp -o compile-time-primes-2.asm
#include <array>
#include <iostream>
template<typename T>
@oblitum
oblitum / 1-clang-O3.asm
Created October 11, 2013 17:17
yeppp! a trivial test's clang intel syntax assembly
call _ZNSt6chrono3_V212system_clock3nowEv
.Ltmp100:
mov r14, rax
.Ltmp101:
#DEBUG_VALUE: i <- 0
.align 16, 0x90
.LBB0_6: # %.lr.ph.i.preheader
# =>This Loop Header: Depth=1
# Child Loop BB0_7 Depth 2
#DEBUG_VALUE: size <- 1024
// Better POST-MORTEM than never! 💀
package main
import (
"errors"
"fmt"
)
type RelationshipSet struct {
@oblitum
oblitum / index.html
Created April 11, 2016 06:53 — forked from biovisualize/index.html
Posting gist/blocks to blogger
<!-- Override Gist styling -->
<style type="text/css">
iframe{background-color: #0a0a0a;}
div.gist-syntax {background-color:#0a0a0a!important;}
div.gist {color:#ccc!important;}
span.nt, span.kd, span.k, span.o{color:aliceblue!important;}
.gist .gist-file{border-color:#444!important;}
.gist .gist-file .gist-meta{background-color:#0a0a0a!important;}
</style>
@oblitum
oblitum / Main.purs
Last active October 24, 2017 09:52
nature invented it first
module Main where
import Prelude
import Data.Array (take)
import Data.Foldable (foldMap)
import Data.Unfoldable (replicateA)
import Partial.Unsafe (unsafePartial)
import Data.Maybe (Maybe(..), fromJust)
import Math (Radians, log, cos, sin, sqrt, pi)
Bill Gates e Steve Jobs criaram seus filhos livres de tecnologia — e isto devia ter sido um sinal de alerta
Psicólogos estão aprendendo rapidamente quão perigosos celulares podem ser
para jovens.
Pesquisas constatam que o risco de depressão para um jovem da oitava série
pula pra 27% quando ele ou ela usa redes sociais com frequência. Crianças que
usam seus celulares por pelo menos três horas por dia tem muito mais chance de
serem suicidas. Um estudo recente constatou que a taxa de suicídio de jovens nos
EUA agora é muito maior que a taxa de homicídios, com os celulares sendo a
tell application "Google Chrome"
repeat with windowId from 1 to counts windows
if title of window windowId contains "tom.scogland@gmail.com - Gmail" then
activate window windowId
end if
end repeat
end tell
@oblitum
oblitum / Access NSScreen.scpt
Created January 27, 2018 01:27 — forked from henryroe/Access NSScreen.scpt
Demonstration of how to use an AppleScript Bundle to enable access to NSScreen in AppleScriptObjC
(*
Copy and paste this script into a new document in AppleScript Editor.
When saving, select "Script Bundle" as File Type.
Save the file to: "~/Library/Script Libraries/Access NSScreen.scptd"
Note: you may need to create the directory: "~/Library/Script Libraries"
Note: while this gist has the file ending "scpt", by selecting the
"Script Bundle" file type, the file extension "scptd" should be added.
@oblitum
oblitum / .tmux.conf
Last active April 13, 2024 21:07
Configuration for 24bit true colors terminal with italic
set -g default-terminal 'tmux-256color'
# Enable 24 bit true colors
set -ga terminal-overrides ',*:Tc'
@oblitum
oblitum / MATRIX.md
Created February 9, 2018 03:33 — forked from fstab/MATRIX.md
How to use matrix.org and vector.im as an IRC client

How to use matrix.org and vector.im as an IRC client

How to Join an IRC Channel on matrix.org

Join the room #freenode_<#channel>:matrix.org, replacing <#channel> with the name of the IRC channel. For example, in order to join the #prometheus IRC channel, join the room #freenode_#prometheus:matrix.org on matrix.org.

In vector.im, rooms can be joined with the directory symbol on the bottom left.