Skip to content

Instantly share code, notes, and snippets.

View val314159's full-sized avatar

val314159 val314159

View GitHub Profile
@val314159
val314159 / Dockerfile
Created October 19, 2018 23:31
emscripten Dockerfile, slightly updated
FROM buildpack-deps:bionic
RUN apt-get -y update && apt-get -y upgrade && apt-get -y install apt-utils
SHELL ["/bin/bash", "-c"]
ENV DEBIAN_FRONTEND=noninteractive LANG=C.UTF-8
RUN mkdir -p /root/emscripten/
COPY emscripten /root/emscripten/
RUN cd /root/ \
@val314159
val314159 / Makefile
Created October 18, 2018 04:25
Let's get explicit
PROG=hi
all: test
test: $(PROG) ; ./$(PROG)
clean: ; rm -fr *.{o,a,so} *~ $(PROG)
hi: hi.o
$(LD) $(LDFLAGS) $^ -o $@
hi.o: hi.c
$(CC) $(CFLAGS) -c $^ -o $@
@val314159
val314159 / Makefile
Created October 18, 2018 04:22
Real Quick Example
PROG=hi
all: test
test: $(PROG) ; ./$(PROG)
clean: ; rm -fr *.{o,a,so} *~ $(PROG)
@val314159
val314159 / .emacs
Created October 18, 2018 03:11
add this to your .emacs file
;; elisp macro for Ctrl-Z makes
(defun make ()
(interactive)
(compile "makex"))
(global-set-key (kbd "C-z") 'make)
@val314159
val314159 / Makefile
Created October 14, 2018 20:04
cool emcc makefile
DOPTS=-v "`pwd`:/src" --name em trzeci/emscripten
EMCC=docker exec em emcc -Os
# -s EXTRA_EXPORTED_RUNTIME_METHODS='["cwrap","ccall"]'
all: clean main0.html twelve.bc eleven.js
node main1.js
main0.html: main0.bc eleven.bc twelve.bc
$(EMCC) $? -o $@ -s EXPORTED_FUNCTIONS=@main0.json
main1.html: main1.bc eleven.bc twelve.bc
$(EMCC) $? -o $@ -s EXPORTED_FUNCTIONS=1main0.json
%.js: %.bc ; $(EMCC) $? -o $@ -s EXPORTED_FUNCTIONS=@$*.json
@val314159
val314159 / .gitignore
Last active August 27, 2018 01:24
pkcrypt2
*.pyc
*.yky
*~
.ssh
.gitignore
.gitconfig
.ve
.ve2
.ve3
@val314159
val314159 / usleep.c
Created March 29, 2018 18:50
usleep, what every unix should have
/*
cc -o usleep usleep.c && cp usleep /usr/local/bin
*/
#include <unistd.h>
#include <stdlib.h>
int main(int c,char*v[]){
usleep(atoi(v[1]));
}
@val314159
val314159 / classifier_from_little_data_script_3.py
Last active February 22, 2018 12:26 — forked from fchollet/classifier_from_little_data_script_3.py
Fine-tuning a Keras model. Updated to the Keras 2.0.5 API.
'''This script goes along the blog post
"Building powerful image classification models using very little data"
from blog.keras.io.
It uses data that can be downloaded at:
https://www.kaggle.com/c/dogs-vs-cats/data
In our setup, we:
- created a data/ folder
- created train/ and validation/ subfolders inside data/
- created cats/ and dogs/ subfolders inside train/ and validation/
- put the cat pictures index 0-999 in data/train/cats
all:
./ws.py
install:
virtualenv .ve
.ve/bin/pip install -r requirements.txt
mkdir static
echo index >static/index.html
clean:
.ve3
ve
account
password
dd
tx_hash