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
| //blue/1/~/ pacman -Qqe > qqe | |
| //blue/0/~/ pacman -Qqm > qqm | |
| //blue/0/~/ cat qqe | grep -Fvx "$(cat qqm)" | head # useless cat on purpose | |
| abcde | |
| abook | |
| abs | |
| acl | |
| acpid | |
| alsa-lib | |
| alsa-oss |
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
| -- | Conditionally apply the monadic f to the Maybe value when it is | |
| -- Just and wrap the /inner/ value in Just, or return Nothing | |
| (=<?) :: (Monad m) => (a -> m b) -> Maybe a -> m (Maybe b) | |
| f =<? (Just a) = return . Just =<< f a | |
| f =<? Nothing = return Nothing | |
| -- can this not be done with some variation of liftM and fmap? |
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
| mpd config | |
| 299 ## A Fifo output for visualizations in ncmpcpp-git | |
| 300 # | |
| 301 audio_output { | |
| 302 type "fifo" | |
| 303 name "ncmpcpp visualizer" | |
| 304 path "/tmp/mpd.fifo" | |
| 305 format "44100:16:1" |
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
| -- | Execute any mpd action then redirect back to status page | |
| actionRoute :: YesodMPC m => MPD.MPD () -> GHandler MPC m RepHtmlJson | |
| actionRoute f = do | |
| authHelper | |
| _ <- withMPD f | |
| tm <- getRouteToMaster | |
| redirect RedirectTemporary $ tm StatusR | |
| -- | Toggle any mpd setting then redirect back to status page | |
| toggleRoute :: YesodMPC m => Toggle -> GHandler MPC m RepHtmlJson |
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
| module Data.Boolish (Boolish(..)) where | |
| -- | Class for boolean-like datastructures | |
| class Boolish a where | |
| isTrue :: a -> Bool | |
| -- | Default binding is @'not' . 'isTrue'@ | |
| isFalse :: a -> Bool | |
| isFalse = not . isTrue |
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
| {-# LANGUAGE OverloadedStrings #-} | |
| module Search where | |
| import Data.List | |
| import Data.Ord | |
| import Data.Maybe | |
| import qualified Data.Text as T | |
| data SearchResult a = SearchResult | |
| { searchRank :: Double |
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
| {-# LANGUAGE NoImplicitPrelude #-} | |
| -- | |
| -- <http://en.wikipedia.org/wiki/Boolean_satisfiability_problem> | |
| -- | |
| -- In complexity theory, the satisfiability problem (SAT) is a decision | |
| -- problem, whose instance is a Boolean expression written using only | |
| -- AND, OR, NOT, variables, and parentheses. The question is: given the | |
| -- expression, is there some assignment of TRUE and FALSE values to the | |
| -- variables that will make the entire expression true? A formula of | |
| -- propositional logic is said to be satisfiable if logical values can |
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 | |
| # | |
| # makes dialog related methods for X++ | |
| # | |
| ### | |
| message() { echo './dlgmaker.sh type=variable type=variable ...'; exit 1; } | |
| [[ "$1" =~ -h|--help ]] && message |
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 <stdlib.h> | |
| #include <stdio.h> | |
| struct person_t { | |
| char *name; | |
| int age; | |
| }; | |
| int main() { | |
| struct person_t *person; |
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
| /* Original author: Vikraman (vh4x0r @ Freenode) <vikraman.choudhury@gmail.com> */ | |
| #define _GNU_SOURCE | |
| #include <stdio.h> | |
| #include <stdlib.h> | |
| #include <unistd.h> | |
| #include <errno.h> | |
| #include <string.h> | |
| #include <netdb.h> |