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
mysum :: Num a => [a] -> a | |
mysum [] = 0 | |
mysum (x:xs) = x + mysum xs |
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
<?php | |
class NestedFunctions | |
{ | |
public function fn1() | |
{ | |
function nested_fn() { echo 'yay' . "\n"; } | |
nested_fn(); | |
} |
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
<?php | |
require_once __DIR__ . '/vendor/autoload.php'; | |
$file = __DIR__ . '/testfile'; | |
$client= popen('tail -f ' . $file, 'w'); | |
stream_set_blocking($client, 0); | |
$loop = React\EventLoop\Factory::create(); |
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
# grep messages from weechat logs | |
channelgrep() { | |
channel=$1 | |
search=$2 | |
channelFiles=~/.weechat/logs/*#$channel* | |
grep "$search" $channelFiles | |
} |
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
# watch files and rerun phpunit on changes | |
phpunitwait() { | |
while inotifywait $(find $1 -name '*.php'); | |
do | |
clear; | |
phpunit --colors $2; | |
done; | |
} |
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
# switch to dvorak, set key repeat etc | |
/home/alexander/.fixkb | |
# Add local fonts | |
xset fp+ /usr/share/fonts/local & | |
## Gnome keyring | |
source /etc/X11/xinit/xinitrc.d/30-dbus | |
eval $(/usr/bin/gnome-keyring-daemon --start --components=gpg,pkcs11,secrets) |
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
<?php | |
mb_internal_encoding("UTF-8"); | |
$ = 'foo'; | |
$x = 'bar'; | |
echo $ . $x; |
NewerOlder