I hereby claim:
- I am davidad on github.
- I am davidad (https://keybase.io/davidad) on keybase.
- I have a public key whose fingerprint is 7B5E C0A3 23AB 67CA E75E 9BF6 8FCE 72CF 5859 88D7
To claim this, I am signing this object:
| (define (upto n) | |
| (letrec ((loop (lambda (k x) | |
| (if (= k x) (list x) | |
| (cons k (loop (+ k 1) x))) ))) | |
| (loop 1 n))) | |
| (display (upto 10)) |
| create or replace function public.generate_cert(token varchar(32), spkac text, device varchar(32)) returns text as $PERL$ | |
| my $token = $_[0]; | |
| my $spkac = $_[1]; | |
| my $device = $_[2]; | |
| use Crypt::OpenSSL::CA; | |
| use File::Slurp; | |
| my $rowset = spi_exec_query('select auth.certificate_tokens.cert_serial is not null as has_serial, auth.certificate_tokens.entry_id as entry_id, auth.uid_email.email as email, auth.uid_email.uid as uid, (main.people.name).given, (main.people.name).particle, (main.people.name).family, (auth.certificate_tokens.token_expires < now()) as expired from auth.uid_email, main.people, auth.certificate_tokens where auth.uid_email.uid = main.people.uid and auth.uid_email.email = auth.certificate_tokens.email and auth.certificate_tokens.token_digest = digest('.quote_literal($token).",'sha512');",1); |
| // Reference implementation of combinatory algebra | |
| #include <stdio.h> | |
| #include <stdlib.h> | |
| struct term { | |
| enum { | |
| ATOM_S, | |
| ATOM_K, | |
| ATOM_I, |
| #!/bin/bash | |
| ORIGDIR=`pwd | sed 's/\ /\\ /g'` | |
| cd ~/octopress | |
| URL="http://davidad.github.io/" | |
| function wrs() { | |
| if [[ $2 = "y" ]]; then | |
| L1="set theWindow's active tab index to theTabIndex" |
| -- warning: this is hacky. run at your own risk. | |
| -- | |
| -- before you run this, put sum_list.asm in a dynamic library. | |
| -- | |
| -- on OSX that means | |
| -- $ nasm -f macho64 sum_list.asm | |
| -- $ libtool -dynamic sum_list.o -o libsum_list.dylib | |
| -- | |
| -- on Linux it means | |
| -- $ nasm -f elf64 sum_list.asm |
I hereby claim:
To claim this, I am signing this object:
| curl -O -L http://downloads.sourceforge.net/sourceforge/pcre/pcre-8.34.tar.gz | |
| curl -O -L http://openresty.org/download/ngx_openresty-1.5.11.1.tar.gz | |
| tar xzf pcre-8.34.tar.gz | |
| tar xzf ngx_openresty-1.5.11.1.tar.gz | |
| cd ngx_openresty-1.5.11.1 | |
| export PATH=/sbin:$PATH | |
| ./configure --prefix=/app/openresty --with-pcre=/app/pcre-8.34 --with-luajit --with-http_postgres_module --with-file-aio --with-ipv6 --with-http_realip_module --with-http_addition_module --with-http_xslt_module --with-http_sub_module --with-http_dav_module --with-http_flv_module --with-http_gzip_static_module --with-http_random_index_module --with-http_secure_link_module --with-http_degradation_module --with-http_stub_status_module --with-mail --with-mail_ssl_module --with-pcre-jit --with-http_iconv_module -j2 | |
| make | |
| make install | |
| tar czf openresty_build-1.5.11.1-1.tar.gz openresty |
| %include "os_dependent_stuff.asm" | |
| global fib | |
| global _fib | |
| fib: | |
| _fib: | |
| cmp rdi, 1 | |
| jle return_one; if the relationship is "less than or equal", goto return_one | |
| push rdi ; save n | |
| mov rsi, rdi | |
| inc rsi ; rsi now contains n+1 |
| global fib | |
| global _fib | |
| fib: | |
| _fib: | |
| cmp rdi, 1 ; set flags according to value of rdi minus one, i.e., relationship of rdi to 1 | |
| jle return_one; if the relationship is "less than or equal", goto return_one | |
| dec rdi ; rdi = rdi - 1 | |
| push rdi ; ^ this guy is going to decrement it again, save "n-1" on the stack | |
| call fib ; do call | |
| pop rdi ; restore "n-1" to rdi |
| #include <stdlib.h> | |
| #include <stdio.h> | |
| extern unsigned long fib(unsigned long); | |
| int main(int argc, char* argv[]) { | |
| if(argc<2) printf("usage: fib_test <integer>\n"), exit(1); | |
| unsigned long input = strtoul(argv[1],NULL,10); // string to unsigned long | |
| printf("fib(%lu) = %lu\n",input,fib(input)); | |
| return 0; |