Skip to content

Instantly share code, notes, and snippets.

@Thomashrb
Thomashrb / togglexkbmap.sh
Created November 5, 2019 22:28
toggle keyboard layout
#!/bin/bash
(setxkbmap -query | grep -q "layout:\s\+us") && setxkbmap no || setxkbmap us
@Thomashrb
Thomashrb / .spacemacs
Created June 18, 2018 10:50 — forked from adetokunbo/.spacemacs
.spacemacs enabling dante mode/nix/cabal in spacemacs main branch
;;; ...
;;; ...
;; List of additional packages that will be installed without being
;; wrapped in a layer. If you need some configuration for these
;; packages, then consider creating a layer. You can also put the
;; configuration in `dotspacemacs/user-config'.
;; Cabal/Nix haskell setup
dotspacemacs-additional-packages '(dante nix-sandbox)
# http://datakurre.pandala.org/2015/10/nix-for-python-developers.html
with import <nixpkgs> {};
stdenv.mkDerivation rec {
name = "env";
# Mandatory boilerplate for buildable env
env = buildEnv { name = name; paths = buildInputs; };
builder = builtins.toFile "builder.sh" ''
source $stdenv/setup; ln -s $env $out
'';
@Thomashrb
Thomashrb / count numbers
Created January 27, 2017 09:50
c++ count bits lab04
//calculate
void util_heltall::beregn_data(){
antall_enere=0;
lengde=0;
pos_max_signifikant=0;
//calculate length of number
unsigned long long i = heltall;
while (i > 0){