This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(use-package hydra | |
:config | |
(defhydra hydra-zoom () | |
"zoom" | |
("+" text-scale-increase "in") | |
("-" text-scale-decrease "out") | |
("0" (text-scale-adjust 0) "reset") | |
("q" nil "quit" :color red)) | |
(defhydra hydra-move () |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
int __attribute__((noinline)) test_saturate_add(int x, int y) { | |
int c = x + y; | |
if(c < x || c < y) | |
c = INT_MAX; | |
return c >= x && c >= y; | |
} | |
# Compiles to (with clang -O2) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{-# LANGUAGE GADTs #-} | |
{-# LANGUAGE RankNTypes #-} | |
{-# LANGUAGE ScopedTypeVariables #-} | |
{-# LANGUAGE TypeFamilies #-} | |
{-# LANGUAGE TypeInType #-} | |
{-# LANGUAGE TypeOperators #-} | |
{-# OPTIONS_GHC -Wall #-} | |
import Control.Monad.ST ( RealWorld ) | |
import Control.Monad ( guard ) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ASM | |
0001010c <f1>: | |
1010c: e92d4800 push {fp, lr} | |
10110: e28db004 add fp, sp, #4 | |
10114: e24dd008 sub sp, sp, #8 | |
10118: e50b0008 str r0, [fp, #-8] | |
1011c: e51b3008 ldr r3, [fp, #-8] | |
10120: e2833001 add r3, r3, #1 | |
10124: e1a00003 mov r0, r3 | |
10128: ebffffea bl 100d8 <f2> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
0001010c <f1>: | |
1010c: e92d4800 push {fp, lr} | |
10110: e28db004 add fp, sp, #4 | |
10114: e24dd008 sub sp, sp, #8 | |
10118: e50b0008 str r0, [fp, #-8] | |
1011c: e51b3008 ldr r3, [fp, #-8] | |
10120: e2833001 add r3, r3, #1 | |
10124: e1a00003 mov r0, r3 | |
10128: ebffffea bl 100d8 <f2> | |
1012c: e1a00000 nop ; (mov r0, r0) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Machine code | |
0001010c <f1>: | |
1010c: e92d4800 push {fp, lr} | |
10110: e28db004 add fp, sp, #4 | |
10114: e24dd008 sub sp, sp, #8 | |
10118: e50b0008 str r0, [fp, #-8] | |
1011c: e51b3008 ldr r3, [fp, #-8] | |
10120: e2833001 add r3, r3, #1 | |
10124: e1a00003 mov r0, r3 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(setq custom-file "~/.emacs.d/custom.el") | |
(load custom-file 'noerror) | |
;; Speed startup | |
(setq inhibit-startup-message t) | |
(setq inhibit-startup-buffer-menu t) | |
(defconst gui-font (if (eq system-type 'darwin) | |
"Source Code Pro-14" | |
"Source Code Pro-12")) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Prelude hiding ( mapM, mapM_, catch, sequence, sequence_, foldl, foldr, concat, concatMap, and, or, any, all, elem, notElem, maximum, minimum, sum, product, foldl1, foldr1, (.), id) | |
import Control.Applicative | |
import Control.Arrow | |
import Control.Category | |
import Control.Exception | |
import Data.Foldable | |
import Data.Monoid | |
import Data.Traversable | |
:set prompt "> " |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <pthread.h> | |
struct ThreadBase | |
{ | |
virtual ~ThreadBase(){} | |
virtual void* operator() () = 0; | |
}; | |
template<typename CallableObject> | |
struct ThreadTask : public ThreadBase |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{-# LANGUAGE OverloadedStrings, RankNTypes, KindSignatures, FlexibleContexts #-} | |
module Plugins.NotificationDaemon where | |
-- xmobar plugin API | |
import Plugins | |
import DBus.Bus | |
import DBus.Client | |
import DBus.Constants |