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
import System.Environment (getArgs) | |
import Control.Monad (liftM) | |
import Criterion.Main | |
testElemS :: String -> Bool | |
testElemS = flip elem ["a", "b", "c", "d", "e"] | |
testCondS :: String -> Bool | |
testCondS x = (x == "a" || x == "b" || x == "c" || x == "d" || x == "e") |
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/bash | |
echo "Looking for failed csum inodes...." | |
inodes=`dmesg | grep csum | sed 's/^.*ino \([0-9]*\) .*$/\1/g' | uniq` | |
echo "Finding system files from inodes..." | |
sysfiles=`for i in $inodes; do find /etc /opt /root /srv /usr /var -inum $i 2>/dev/null; done` | |
echo "Finding user files from inodes..." | |
homefiles=`for i in $inodes; do find /home -inum $i 2>/dev/null; done` | |
echo "Attempting to reinstall corrupted packages..." | |
# Get list of packages with corrupt files | |
packages=$(for f in $sysfiles; do pacman -Qqo $f 2>/dev/null; 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
For I have every confidence that the effort I have applied to the science | |
reported upon here, which has occupied a considerable span of my lifetime and | |
demanded the most intense exertions of my powers, is not to be lost. ... a time | |
will come when it will be drawn forth from the dust of oblivion and the ideas | |
laid down here will bear fruit. ... some day these ideas, even if in an altered | |
form, will reappear and with the passage of time will participate in a lively | |
intellectual exchange. For truth is eternal, it is divine; and no phase in the | |
development of truth, however small the domain it embraces, can pass away | |
without a trace. It remains even if the garments in which feeble men clothe it | |
fall into dust. |
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 python3 | |
""" | |
Script to load NIST SP800-90A Dual_EC_DRBG curve parameters into Python. | |
Requires Python 3. | |
Henry de Valence <[email protected]> | |
""" | |
def hexi(s): | |
# python is picky about having 2 chars / byte, so pad zeros. |
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
[Unit] | |
Description=Redshift display colour temperature adjustment | |
Documentation=http://jonls.dk/redshift/ | |
After=display-manager.service | |
[Service] | |
ExecStart=/usr/bin/redshift | |
Restart=always | |
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
You appear to be advocating a new: | |
[ ] cloud-hosted [*] locally installable [ ] web-based [*] browser-based [ ] language-agnostic | |
[ ] language-specific IDE. Your IDE will not succeed. Here is why it will not succeed. | |
You appear to believe that: | |
[ ] Syntax highlighting is what makes programming difficult | |
[*] Garbage collection is free | |
[*] Computers have infinite memory | |
[*] Nobody really needs: |
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
# Maintainer: Henry de Valence <[email protected]> | |
pkgname=osrm-git | |
pkgver=20140603 | |
pkgrel=1 | |
pkgdesc="Open-Source Routing Machine" | |
arch=('i686' 'x86_64') | |
url="http://project-osrm.org/" | |
license=('BSD') | |
depends=('libstxxl' 'protobuf' 'luajit' 'luabind' 'boost-libs' 'libxml2') | |
makedepends=('git') |
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
;;; adapted from https://groups.google.com/forum/#!topic/comp.emacs/SU6h21mb0ds | |
;;; TODO get the fg/bg colors from the current theme? | |
(defun doc-view-solarized () | |
"to view solarized pdfs" | |
(interactive) | |
(let ((pattern (format "%s/*.png" doc-view--current-cache-dir)) ) | |
(dolist (png-fname(file-expand-wildcards pattern)) | |
(start-process-shell-command | |
"-doc-view-inverting-" "-doc-view-inverting-" | |
"convert" png-fname "-fill '#002b36' -opaque white -fill '#eee8d5' -opaque black" png-fname)) |
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
diff --git a/helm-bibtex.el b/helm-bibtex.el | |
index 363c2a1..13b7153 100644 | |
--- a/helm-bibtex.el | |
+++ b/helm-bibtex.el | |
@@ -109,7 +109,8 @@ composed of the BibTeX-key plus a \".pdf\" suffix." | |
:group 'helm-bibtex | |
:type '(choice directory (repeat directory))) | |
-(defcustom helm-bibtex-pdf-open-function 'find-file | |
+;(defcustom helm-bibtex-pdf-open-function 'find-file |
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
# v--- endianness issues here | |
bytestr_to_arr = lambda s:"[" + ", ".join(['0x'+b+a for a,b in zip(s[0::2], s[1::2])]) + "]" | |
ZZtobytestr = lambda x: "".join(ZZ(x).digits(16, '0123456789abcdef')) |
OlderNewer