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
require 'httparty' | |
require 'uri' | |
def get_file_names(zip_url) | |
# ZIP file format: https://en.wikipedia.org/wiki/ZIP_(file_format) | |
# 1. Do an initial head request to figure out how big the file is from the | |
# content size | |
response = HTTParty.head(zip_url) | |
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
# http-server | |
rene $ for i in 16 128; do ab -c $i -n $i http://127.0.0.1:8080/ | grep "Time per"; done | |
Time per request: 20.492 [ms] (mean) | |
Time per request: 1.281 [ms] (mean, across all concurrent requests) | |
Time per request: 138.750 [ms] (mean) | |
Time per request: 1.084 [ms] (mean, across all concurrent requests) | |
# serve | |
rene $ for i in 16 128; do ab -c $i -n $i http://127.0.0.1:8080/ | grep "Time per"; done | |
Time per request: 3.465 [ms] (mean) |
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
valgrind --tool=callgrind ./oclinf |
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
INC=-I/Users/rene/Code/OpenCL-Headers/opencl12 | |
PKG=`pkg-config --cflags --libs opencv` | |
LD=`pkg-config --libs-only-L opencv | cut -c 3-` | |
.PHONY: default a.out.lldb | |
default: build | |
LD_LIBRARY_PATH=$(LD) ./a.out | |
lldb: build a.out.lldb | |
LD_LIBRARY_PATH=$(LD) lldb --source a.out.lldb |
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
rene $ ls -la | |
total 0 | |
drwxr-xr-x 2 rene staff 68 Nov 22 15:22 . | |
drwxr-xr-x 26 rene staff 884 Nov 22 14:15 .. | |
[~/Code/leptonica/build] (master) | |
rene $ tree ../dependencies/install/ | |
../dependencies/install/ | |
├── bin | |
│ ├── cjpeg | |
│ ├── djpeg |
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
ls | head -$(($RANDOM % `ls | wc -l` + 1)) | tail -1 |
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
#!/usr/bin/env bash | |
# md5c | |
# | |
# Perform md5 checksum validation of a file against | |
# a specified md5 hash. | |
# | |
# usage: md5c filename hash | |
function md5c { | |
filename="$1" |
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
var WhenHandler = function(id) { | |
this.elm = document.querySelector("#" + id); | |
this.scrolled_into_view = false; | |
this.scroll_callback; | |
this.doc = document.documentElement; | |
this.doc_bounds = this.doc.getBoundingClientRect(); | |
this.elm_bounds = this.elm.getBoundingClientRect(); | |
} |
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 <stdlib.h> | |
int pointer_pointer_function(int **pp) | |
{ | |
printf("EQUAL WAYS OF ADDRESSING:\n"); | |
printf("*(*pp + 0): %d\n", (int) *(*pp + 0)); | |
printf("*(*pp + 1): %d\n", (int) *(*pp + 1)); | |
printf("*(*pp + 2): %d\n", (int) *(*pp + 2)); |
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
find . -name "*.epub" -exec sh -c 'ebook-convert "{}" "$(dirname "{}")/$(basename -s .epub "{}").mobi" &' \; |
NewerOlder