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
(use spiffy matchable test channel) | |
(include "server.scm") | |
(include "alist-util.scm") | |
;; events: `(event ...) | |
;; event: `(ekey event) | |
;; ekey: `(atype aid) | |
;; ==================== event-store ==================== | |
(define (make-event-store) `(event-store . () )) |
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 <stdio.h> | |
#include <alsa/asoundlib.h> | |
static char card[64] = "default"; | |
static void error(const char *fmt,...) | |
{ | |
va_list va; |
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
LOCAL_PATH := $(call my-dir) | |
include $(CLEAR_VARS) | |
LOCAL_SRC_FILES := src/core/epbase.c src/core/sock.c src/core/poll.c \ | |
src/core/symbol.c src/core/ep.c src/core/pipe.c \ | |
src/core/sockbase.c src/core/global.c src/devices/device.c \ | |
src/transports/inproc/ins.c src/transports/inproc/inproc.c \ | |
src/transports/inproc/cinproc.c src/transports/inproc/binproc.c \ | |
src/transports/inproc/sinproc.c src/transports/inproc/msgqueue.c \ |
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
// code from http://paulbourke.net/miscellaneous/dft/ | |
// help from http://www.codeproject.com/Articles/9388/How-to-implement-the-FFT-algorithm | |
#include <stdio.h> | |
#include <math.h> | |
#include <stdlib.h> | |
/* | |
This computes an in-place complex-to-complex FFT | |
x and y are the real and imaginary arrays of 2^m points. | |
dir = 1 gives forward transform |
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
# build nanomsg for Android's aosp | |
# hope this is useful for someone! :D | |
LOCAL_PATH := $(ANDROID_BUILD_TOP)/external/nanomsg/src | |
include $(CLEAR_VARS) | |
LOCAL_SRC_FILES := core/epbase.c core/sock.c core/poll.c \ | |
core/symbol.c core/ep.c core/pipe.c \ | |
core/sockbase.c core/global.c devices/device.c \ |
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
! Use a nice truetype font and size by default... | |
! xterm ---------------------------------------------------------------------- | |
xterm*VT100.geometry: 80x25 | |
xterm*faceName: Inconsolata:style=Regular:size=8 | |
!xterm*font: -*-dina-medium-r-*-*-16-*-*-*-*-*-*-* | |
xterm*dynamicColors: true | |
xterm*utf8: 2 | |
xterm*eightBitInput: true | |
xterm*saveLines: 65568 |
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
expected="c109d23ad00e8a50cf33ae1c3d811b2cd7a0bafe" | |
fn=index.html | |
curl -s google.com/$fn > /$fn.part | |
cs=`sha1sum /$fn.part | cut -d " " 1` | |
if [ "$cs" == "$expected"] ; then | |
echo "checksum ok $cs" | |
mv /$fn.part /$fn:$cs |
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
(use sdl2 miscmacros (prefix opengl-glew gl:) glls-render gl-utils gl-math) | |
;; unhappy REPL on Android? (import (prefix opengl-glew gl:)) | |
(define window (create-window! "sokoworld" 0 0 640 480 '(resizable opengl))) | |
(gl-attribute-set! 'context-major-version 3) | |
(gl-attribute-set! 'context-minor-version 0) | |
(gl-create-context! window) | |
(gl:init) |
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
(use matchable hmac sha2 base64 tweetnacl) | |
(define (base64url-decode m) (base64-decode (string-translate m "-_" "+/"))) | |
(define (base64url-encode m) | |
(string-trim-right ;; remove = padding (not used/needed in jwt) | |
(string-translate (base64-encode m) "+/" "-_") #\=)) | |
(define (hs256 secret) (hmac secret (sha256-primitive))) | |
;; b64header ignored! (read https://auth0.com/blog/2015/03/31/critical-vulnerabilities-in-json-web-token-libraries/) |
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
modified hello-world.c | |
@@ -1,6 +1,5 @@ | |
#include <stdio.h> | |
int main() { | |
- fprintf(stderr, "Goodbye, "); | |
- fputs("World!\n", stderr); | |
+ fprintf(stderr, "Goodbye, World!\n"); | |
return 0; | |
} |