Skip to content

Instantly share code, notes, and snippets.

View tilpner's full-sized avatar

Till Höppner tilpner

  • Germany
View GitHub Profile
@tilpner
tilpner / config.nix
Created February 13, 2019 12:39
Apparmor profiles from closure
{ ... }: {
security.apparmor.enable = true;
security.apparmor.profiles = [
(pkgs.mkApparmorProfile rec {
subject = pkgs.pbServe;
runtimeDeps = [ subject pkgs.tzdata ];
append = [
"${config.users.users.static.home}** r"
];
rlimit.as = 100 * pkgs.lib.units.megabyte;
# screen brightness
bindsym $mod+F8 exec --no-startup-id xbacklight -10
bindsym $mod+F9 exec --no-startup-id xbacklight +10
bindsym $mod+Shift+F8 exec --no-startup-id xbacklight = 1
bindsym $mod+Shift+F9 exec --no-startup-id xbacklight = 100
# pulse volume
bindsym $mod+z exec --no-startup-id pactl set-sink-mute @DEFAULT_SINK@ toggle
bindsym XF86AudioRaiseVolume exec --no-startup-id pactl set-sink-volume @DEFAULT_SINK@ +10%
bindsym XF86AudioLowerVolume exec --no-startup-id pactl set-sink-volume @DEFAULT_SINK@ -10%
function __fish_using_command
set cmd (commandline -opc)
if [ (count $cmd) -eq (count $argv) ]
for i in (seq (count $argv))
if [ $cmd[$i] != $argv[$i] ]
return 1
end
end
return 0
end
This file has been truncated, but you can view the full file.
function globalEval(a){eval.call(null,a)}function assert(a,b){a||abort("Assertion failed: "+b)}function getCFunc(ident){var func=Module["_"+ident];if(!func)try{func=eval("_"+ident)}catch(a){}return assert(func,"Cannot call unknown function "+ident+" (perhaps LLVM optimizations or closure removed it?)"),func}function setValue(a,b,c,d){switch(c=c||"i8","*"===c.charAt(c.length-1)&&(c="i32"),c){case"i1":HEAP8[a>>0]=b;break;case"i8":HEAP8[a>>0]=b;break;case"i16":HEAP16[a>>1]=b;break;case"i32":HEAP32[a>>2]=b;break;case"i64":tempI64=[b>>>0,(tempDouble=b,+Math_abs(tempDouble)>=1?tempDouble>0?(0|Math_min(+Math_floor(tempDouble/4294967296),4294967295))>>>0:~~+Math_ceil((tempDouble-+(~~tempDouble>>>0))/4294967296)>>>0:0)],HEAP32[a>>2]=tempI64[0],HEAP32[a+4>>2]=tempI64[1];break;case"float":HEAPF32[a>>2]=b;break;case"double":HEAPF64[a>>3]=b;break;default:abort("invalid type for setValue: "+c)}}function getValue(a,b,c){switch(b=b||"i8","*"===b.charAt(b.length-1)&&(b="i32"),b){case"i1":return HEAP8[a>>0];case"i8":return HEA
This file has been truncated, but you can view the full file.
#!/usr/bin/env node
/*
vim: set ts=8 sts=2 et sw=2 tw=79:
Copyright (C) 2013
This software is provided 'as-is', without any express or implied
warranty. In no event will the authors be held liable for any damages
arising from the use of this software.
Permission is granted to anyone to use this software for any purpose,
@tilpner
tilpner / main.rs
Created September 19, 2016 13:19
extern crate libc;
use std::{thread, process};
use std::time::Duration;
fn sigint_handler(sig: libc::c_int) {
if sig != libc::SIGINT {
println!("Oops, not for me. Ignoring {}.", sig);
return;
}
extern crate cursive;
use std::env;
use cursive::prelude::*;
fn main() {
// Creates the cursive root - required for every application.
let mut siv = Cursive::new();
let msg = format!("Hi. Do the borders look broken to you too?
macro_rules! attr_each {
($attr: meta for $($i: item)*) => {
$(
#[$attr]
$i
)*
}
}
attr_each! {
[look]
align_end_of_lines = message
bar_more_down = "++"
bar_more_left = "<<"
bar_more_right = ">>"
bar_more_up = "--"
bare_display_exit_on_input = on
bare_display_time_format = "%H:%M"
buffer_auto_renumber = off
buffer_notify_default = highlight
[package]
authors = ["Till Höppner <till@hoeppner.ws>"]
name = "quux"
version = "0.1.0"
[dependencies]
mioco = "0.4.1"
time = "0.1.35"