Skip to content

Instantly share code, notes, and snippets.

View hdevalence's full-sized avatar

Henry de Valence hdevalence

View GitHub Profile
@hdevalence
hdevalence / gist:9181655
Created February 24, 2014 03:45
Grassman on "ars longa, vita brevis"
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.
#!/usr/bin/env python3
"""
Script to load NIST SP800-90A Dual_EC_DRBG curve parameters into Python.
Requires Python 3.
Henry de Valence <hdevalence@hdevalence.ca>
"""
def hexi(s):
# python is picky about having 2 chars / byte, so pad zeros.
[Unit]
Description=Redshift display colour temperature adjustment
Documentation=http://jonls.dk/redshift/
After=display-manager.service
[Service]
ExecStart=/usr/bin/redshift
Restart=always
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:
# Maintainer: Henry de Valence <hdevalence@hdevalence.ca>
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')
;;; 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))
@hdevalence
hdevalence / gist:8050365
Created December 20, 2013 04:16
cond vs elem test
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")
@hdevalence
hdevalence / gist:ef5d8fe85ce837bc45a3e77e91a56577
Created September 11, 2016 21:33
helm-bibtex changes i never documented and then forgot??
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
@hdevalence
hdevalence / gist:d118f270ac1177fd0c357640433ab8aa
Created June 22, 2018 23:11
dalek avx2 benchmark commands
git clone https://github.com/dalek-cryptography/curve25519-dalek.git
cd curve25519-dalek
git checkout 0.18.0
echo "nightly-2018-06-19" > rust-toolchain
export RUSTFLAGS="-C target_cpu=znver1"
cargo bench --features "nightly u64_backend" "aA+bB"
cargo bench --features "nightly avx2_backend" "aA+bB"
@hdevalence
hdevalence / expanded.rs
Last active August 24, 2018 06:31
example of zkp-expanded dleq with merlin
create_nipk!{dleq, (x), (A, B, G, H) : A = (G * x), B = (H * x) }
mod dleq {
use curve25519_dalek::ristretto::RistrettoPoint;
use curve25519_dalek::scalar::Scalar;
use curve25519_dalek::traits::{MultiscalarMul, VartimeMultiscalarMul};
use merlin::Transcript;
use rand::thread_rng;
use std::iter;