/trigger addreplace libera_idlerpg_login_join signal libera,irc_in2_353 "${text} =~ ^. #idlerpg :(.+ )?@idlebot( |$)" "" "/msg -server ${server} idlebot login user password"
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
parse_ip (Packet) -> | |
case Packet of | |
<<4:4, HeaderLength:4, _DiffServ:8, _Length:16, _Identification:16, | |
_Flags:3, _FragOffset:13, _TTL:8, Protocol:8, _HeaderChecksum:16, | |
SrcAddr:32/bits, DstAddr:32/bits, OptionsAndData/bytes>> | |
-> | |
OptionsLength = HeaderLength*32-160, | |
<<_Options:OptionsLength, Data/bytes>> = OptionsAndData, | |
case Protocol of |
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 /etc/pulse/default.pa | |
load-module module-ladspa-sink sink_name=ladspa_limiter sink_properties=device.description="Limiter" master=alsa_output.pci-0000_00_14.2.analog-stereo plugin=fast_lookahead_limiter_1913 label=fastLookaheadLimiter control=12,0,2 | |
load-module module-ladspa-sink sink_name=ladspa_eq sink_properties=device.description="Equalizer\ and\ Limiter" master=ladspa_limiter plugin=mbeq_1197 label=mbeq control=-24,-24,-24,0,0,0,0,0,0,0,0,0,0,0,0 | |
set-default-sink ladspa_eq |
Using Z3 to generate a slightly more optimal Minecraft sugarcane/water block layout compared to the farm presented by Mysticat in Top 3 Minecraft Sugarcane Farms at 7:32.
Original (190 sugarcanes):
Optimized (200 sugarcanes):
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
from itertools import cycle | |
from z3 import * | |
class NameGen: | |
def __init__(self, prefix): | |
self.prefix = prefix | |
self.count = 0 | |
def gen(self): |
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
to_rgb | |
dct | |
abs | |
log | |
cut 0,8 | |
normalize 0,255 |
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
# http://libtorrent.rakshasa.no/wiki/RTorrentRatioHandling | |
ratio.enable = | |
ratio.min.set = 200 | |
ratio.max.set = 0 | |
ratio.upload.set = 0 | |
system.method.set = group.seeding.ratio.command, d.close=, d.erase= | |
# Link when finished. | |
system.method.set_key = event.download.finished, link_finished, "execute = mkdir, -p, ../done; execute = cp, -al, --, $d.get_base_path=, ../done/" |
<lambdabot> shachaf says: getLine :: IO String contains a String in the same
way that /bin/ls contains a list of files
There are multiple ways IO
could be implemented internally. Here’s a demonstration of one.
MiniIO
(below) implements an ADT of arbitrarily chosen primitives that represent I/O operations and a way to combine them. One can create, evaluate and manipulate MiniIO
values without causing any side effects to occur. That is what example
in Main.hs
does. The same applies to real IO
values in Haskell: you can create a big list of print "hello"
s and later pick which ones to actually execute.
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/bin/env stack | |
{- stack | |
--resolver lts-15.15 | |
script | |
--package ersatz | |
-} | |
{-# LANGUAGE DeriveGeneric #-} | |
{-# LANGUAGE GeneralizedNewtypeDeriving #-} | |
{-# LANGUAGE RecordWildCards #-} |
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/bin/env stack | |
{- stack | |
--resolver lts-15.15 | |
script | |
--package ersatz | |
--package containers | |
-} | |
{-# LANGUAGE RecordWildCards #-} | |
{-# LANGUAGE TypeApplications #-} |