Skip to content

Instantly share code, notes, and snippets.

View qpfiffer's full-sized avatar
🔚

Quinlan Pfiffer qpfiffer

🔚
View GitHub Profile
λ:/tmp --sysroot=/tmp/
bash: --sysroot=/tmp/: No such file or directory
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <olegdb/oleg.h>
/* Compile with:
* gcc -g3 -O2 basic.c -o test_basic -loleg
*/
#include <stdio.h>
#include <stdlib.h>
#include <stdint.h>
#include <string.h>
// string_compare_guy compares the contents of the left hand side, length with the contents of the
// right hand side, length and returns 1 if the right hand side (needle) is inside the left hand
// side (haystack).
static int string_compare_guy(char* lhs, int llength, char* rhs, int rlength) {
char lnz[llength + 1];
(master)
λ:~/src/simple_sparsehash ./run_tests.sh
Passed: test_cannot_set_bigger_elements
Passed: test_cannot_set_outside_bounds
Passed: test_cannot_get_outside_bounds
Passed: test_empty_array_does_not_blow_up
Passed: test_array_set
Passed: test_array_set_backwards
Passed: test_array_set_overwrites_old_values
Passed: test_array_set_high_num
# Access elements of a dictionary or a class by string:
def get_var_ruby_style(var, x):
return x[var] if type(x).__name__ == 'dict' else getattr(x, var)
# Return a bound function that always accesses said element, like 'get_var_bound_ruby_style("added_at")' would
# always access the "added_at" value of whatever you pass in to it. Hooray closures!
def get_var_bound_ruby_style(var):
def bound_ruby_style(x):
return get_var_ruby_style(var, x)
return bound_ruby_style
-- Installing: /home/quinlan/src/Polycode/Standalone/../Release/Linux/Standalone/Docs/html/css/bootstrap-theme.min.css
-- Installing: /home/quinlan/src/Polycode/Standalone/../Release/Linux/Standalone/Docs/html/css/bootstrap.css
-- Installing: /home/quinlan/src/Polycode/Standalone/../Release/Linux/Standalone/Docs/html/css/bootstrap.css.map
-- Installing: /home/quinlan/src/Polycode/Standalone/../Release/Linux/Standalone/Docs/html/css/bootstrap.min.css
-- Installing: /home/quinlan/src/Polycode/Standalone/../Release/Linux/Standalone/Docs/html/css/docs.css
-- Installing: /home/quinlan/src/Polycode/Standalone/../Release/Linux/Standalone/Docs/html/images
-- Installing: /home/quinlan/src/Polycode/Standalone/../Release/Linux/Standalone/Docs/html/images/docs_header.png
-- Installing: /home/quinlan/src/Polycode/Standalone/../Release/Linux/Standalone/Docs/html/images/polycode_logo.svg
-- Installing: /home/quinlan/src/Polycode/Standalone/../Release/Linux/Standalone/Docs/html/js
-- Installing: /home/quinlan/src/Polycode/St
λ:/tmp cd test_dir/
λ:/tmp/test_dir ls
λ:/tmp/test_dir touch test
λ:/tmp/test_dir rm test
λ:/tmp/test_dir touch i_already_exist
<html>
<body>
xXx SCREAM _include.html xXx
<li>This is a test. a</li>
<li>This is a test. b</li>
<li>This is a test. c</li>
<html>
<body>
xXx SCREAM _include.html xXx
<li>This is a test. a</li>
xXx BBL xXx
<span>This is the real TrIcKy 1</span>
<p>This is a regular string: This is a test.</p>
<p>This is an integer: 666</p>
<ul>
@qpfiffer
qpfiffer / DHTFS.markdown
Last active August 29, 2015 14:17
DHTFS Goals

Use-case:

waifu.xyz uses a lot of storage. I'm cheap and I don't want to pay for HUEG BOXEN so I just want to pay for a handful cheap boxes and spread the storage load between them. #nodeps, son

Priorities:

  • Learn Go
  • Get it up and running fast
  • Ability to list files
  • Modification of data not strictly necessary, write-once will probably be good enough