This file contains hidden or 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
// | |
// pthread_t is usually an unsigned long, at least on Linux, but POSIX | |
// does not guarantee this. | |
// | |
#include <pthread.h> | |
#include <iostream> | |
int main() | |
{ |
This file contains hidden or 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
Prelude> :load microlens-ex.hs | |
[1 of 1] Compiling Main ( microlens-ex.hs, interpreted ) | |
microlens-ex.hs:17:5: error: | |
• No instance for (Data.String.IsString (Maybe Text)) | |
arising from the literal ‘"true"’ | |
• In the first argument of ‘(&)’, namely ‘"true"’ | |
In the expression: "true" & _Bool .~ False | |
In an equation for ‘b’: b = "true" & _Bool .~ False | |
| |
This file contains hidden or 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
Prelude> :load microlens-ex.hs | |
[1 of 1] Compiling Main ( microlens-ex.hs, interpreted ) | |
microlens-ex.hs:13:20: error: | |
• Variable not in scope: | |
(^?) | |
:: Text -> ((Integer -> f7 Integer) -> t10 -> f7 t10) -> Maybe Int | |
• Perhaps you meant one of these: | |
‘^’ (imported from Prelude), ‘^^’ (imported from Prelude) | |
| |
This file contains hidden or 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 | |
openssl pkcs12 -in usercred.p12 -nokeys -out usercert.pem | |
openssl pkcs12 -in usercred.p12 -nocerts -out userkey-with-pass.pem | |
openssl rsa -in userkey-with-pass.pem -out userkey.pem | |
This file contains hidden or 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
hardstatus on | |
hardstatus alwayslastline | |
hardstatus string "%{.bW}%-w%{.rW}%n %t%{-}%+w %=%{..G} %H %{..Y} %m/%d %C%a "@ | |
escape ^jj | |
This file contains hidden or 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 | |
# Stick this in ~/.bashrc or ~/.bash_profile: | |
if [ ! -S ~/.ssh/ssh_auth_sock ]; then | |
eval $(ssh-agent -s) | |
ln -sf "$SSH_AUTH_SOCK" ~/.ssh/ssh_auth_sock | |
fi | |
export SSH_AUTH_SOCK=~/.ssh/ssh_auth_sock | |
ssh-add -l > /dev/null || ssh-add |
This file contains hidden or 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
:set prompt "λ » " | |
:def h \x -> return $ ":!hoogle -n 15 \"" ++ x ++ "\"" | |
:def hoogle \x -> return $ ":!hoogle -n 15 \"" ++ x ++ "\"" | |
:def doc \x -> return $ ":!hoogle --info \"" ++ x ++ "\"" | |
:def hlint \x -> return $ ":!hlint \"" ++ x ++ "\"" | |
:def package \m -> return $ ":!ghc-pkg --simple-output find-module " ++ m |
This file contains hidden or 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
:set prompt "λ » " | |
:def h \x -> return $ ":!hoogle -c -n 15 \"" ++ x ++ "\"" | |
:def hoogle \x -> return $ ":!hoogle -c -n 15 \"" ++ x ++ "\"" | |
:def doc \x -> return $ ":!hoogle --info \"" ++ x ++ "\"" | |
:def hlint \x -> return $ ":!hlint \"" ++ x ++ "\"" | |
:def browser \ u -> return $ ":!firefox " ++ u |
This file contains hidden or 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 <iostream> | |
#include <stdexcept> | |
// Constructing a string from a null pointer appears to be undefined | |
// behaviour. With GCC 4.8.5, attempting to do so results in a | |
// std::logic_error exception. | |
int main(int argc, char *argv[]) | |
{ | |
try |
This file contains hidden or 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 <iostream> | |
#include <string.h> | |
#include <sys/statvfs.h> | |
/* | |
* How do we find disk usage? You know, the way "df" does? we can | |
* use statvfs() or statfs() calls! The former is moar standard and | |
* POSIX-ey, the latter is BSD-ism that Linux happens to have | |
* implemented. | |
* |