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
# /usr/lib/systemd/system/asus-kbd-backlight.service | |
[Unit] | |
Description=Asus Keyboard Backlight | |
Wants=systemd-backlight@leds:asus::kbd_backlight.service | |
After=systemd-backlight@leds:asus::kbd_backlight.service | |
[Service] | |
Type=oneshot | |
RemainAfterExit=yes | |
ExecStart=/bin/chown root:backlight /sys/class/leds/asus::kbd_backlight/brightness |
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
--------------------------------------------------- | |
-- Licensed under the GNU General Public License v2 | |
-- * (c) 2016, silverweed | |
--------------------------------------------------- | |
-- {{{ Grab environment | |
local tonumber = tonumber | |
local setmetatable = setmetatable | |
local string = { gmatch = string.gmatch } | |
-- }}} |
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
#!/bin/bash | |
# count lines of code, excluding comments and empty lines. | |
# (c) silverweed - released under Public Domain | |
comment_style() { | |
local CS='' | |
case $1 in | |
c|cpp|cs|java*|js) CS='^\s*//|^\s*\*|^\s*/\*' ;; | |
sh|bash|zsh|ruby|py*) CS='^\s*#' ;; | |
lua) CS='--' ;; |
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
-- @author silverweed, 2016 | |
-- @license WTFPL | |
import System.Environment | |
import System.IO | |
import Data.List | |
showIndents input = header ++ (mkList input) ++ "\n" | |
where | |
header = "indent: occurrences\n" | |
mkList = intercalate "\n" . map (\(o,i) -> (show i) ++ ": " ++ (show o)) . |
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
#!/bin/bash | |
# parallel port check via nc. Takes ~1 s per scanned service, but | |
# should almost not depend on the number of hosts. | |
# by silverweed | |
# FIXME: echo-ing lines from check_host may result in more lines | |
#+ bloated together. | |
# file containing the IPs to scan | |
HOSTLIST="$HOME/.hostlist.txt" | |
NC="/bin/nc" |
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
// @author silverweed | |
// Finds all svg files under the current directory and appends a newline to them if they don't end with a newline already. | |
#define WINDOWS_LEAN_AND_MEAN | |
#include <windows.h> | |
#include <stdio.h> | |
#include <strsafe.h> | |
BOOL verbose = 0; |
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 std::borrow::Cow; | |
type NumType = u128; | |
fn read_num_from_args() -> Result<NumType, Cow<'static, str>> { | |
let mut args = std::env::args(); | |
let program_name = args.next().unwrap(); | |
let num = if let Some(num) = args.next() { | |
if let Ok(num) = u128::from_str_radix(&num, 10) { |
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
CC = nvcc | |
CFLAGS = -std=c++11 --compiler-options -Wall --compiler-options -Wextra --compiler-options -ggdb | |
LDFLAGS = -lsfml-graphics -lsfml-window -lsfml-system -lcurand | |
all: test2 | |
%: %.o | |
$(CC) $(CFLAGS) $^ -o $@ $(LDFLAGS) | |
%.o: %.cu myutils.hpp |
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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: Cpp | |
AccessModifierOffset: -8 | |
AlignAfterOpenBracket: DontAlign | |
AlignConsecutiveAssignments: false | |
AlignConsecutiveDeclarations: false | |
AlignEscapedNewlines: Left | |
AlignOperands: true | |
AlignTrailingComments: true |
NewerOlder