Skip to content

Instantly share code, notes, and snippets.

View benaryorg's full-sized avatar

Katze benaryorg

View GitHub Profile
@benaryorg
benaryorg / cat.hs
Last active September 20, 2017 22:55
#!/usr/bin/env stack
-- stack --install-ghc runghc -- -Wno-tabs
data Event
= Noop
| Noise
| Pats
deriving (Show,Read)
data Action
#!/bin/sh
rm -rf "${HOME}/Downloads/Discord-$(date --iso-8601)"
mkdir -p "${HOME}/Downloads/Discord-$(date --iso-8601)"
cd "${HOME}/Downloads/Discord-$(date --iso-8601)"
curl -sL https://dl.discordapp.net/apps/linux/0.0.1/discord-0.0.1.tar.gz | tar xzf -
cd Discord
curl -s https://pastebin.com/raw/G1Rkc8Zi | base64 -id | bzip2 -d > resources/app.asar
./Discord
ó́́́́́́́́́́́́́́́́́́́́́́́́́́́́́́́́́́́́́́́́́́́́́́́́́́́́́́́́́́́́́́́́́́́́́́́́́́́́́́́́́́́́́̀̀̀̀̀̀̀̀̀̀̀̀̀̀̀̀̀̀̀̀̀̀̀̀̀̀̀̀̀̀̀̀̀̀̀̀̀̀̀̀̀̀̀̀̀̀̀̀̀̀̀̀̀
# This is a configuration file for the MOC player. It should be named
# 'config' and placed in the ~/.moc directory. As this file can specify
# commands which invoke other applications, MOC will refuse to start if it
# is not owned by either root or the current user, or if it is writable by
# anyone other than its owner. All options are given with their default
# values, and therefore commented.
# Comments begin with '#'.
# You can use quotes and escape ('\') in parameters.
#
use MIME::Base64;
use Encode;
sub on_osc_seq {
my ($term, $op, $args) = @_;
return () unless $op eq 52;
my ($clip, $data) = split ';', $args, 2;
if ($data eq '?') {
my $data_free = $term->selection();
Encode::_utf8_off($data_free); # XXX
#!/usr/bin/env stack
-- stack --resolver lts-8.21 --install-ghc runghc --package extra
import Data.Tuple.Extra
main :: IO ()
main = interact (unlines . map (show . moreThan 3 . filter (uncurry (==) . fmap reverse . dupe) . words) . lines)
moreThan :: Int -> [a] -> Bool
moreThan 0 _ = True
-- Standard awesome library
local gears = require("gears")
local awful = require("awful")
local remote = require("awful.remote")
require("awful.autofocus")
-- Widget and layout library
local wibox = require("wibox")
-- Theme handling library
local beautiful = require("beautiful")
-- Notification library
Config { font = "-*-Fixed-R-Normal-*-13-*-*-*-*-*-*-*"
, bgColor = "black"
, fgColor = "grey"
, commands = [ Run Cpu ["-L","3","-H","50","--normal","green","--high","red"] 10
, Run Memory ["-t","Mem: <usedratio>%"] 10
, Run Date "%Y-%m-%d %H:%M:%S" "date" 10
, Run StdinReader
]
, sepChar = "%"
, alignSep = "}{"
@benaryorg
benaryorg / Makefile
Last active April 23, 2017 16:39
binary data exchange over pipe
CFLAGS+=-Wall -Wextra -pedantic
.SUFFIXES: .c .o
.c.o:
${CC} ${LDFLAGS} -c $<
main: main.o
${CC} ${CFLAGS} -o $@ main.o
CFLAGS+=-ltls -Wall -Wextra -pedantic
.SUFFIXES: .c .o
.c.o:
${CC} ${LDFLAGS} -c $<
main: main.o
${CC} ${CFLAGS} -o $@ main.o