Skip to content

Instantly share code, notes, and snippets.

View davvid's full-sized avatar

David Aguilar davvid

  • Walt Disney Animation Studios
  • Los Angeles
View GitHub Profile
@JoergWMittag
JoergWMittag / yelp_sample_response.json
Created June 10, 2010 16:43
Sample response for the Yelp search API
{"businesses":[
{"address1":"466 Haight St",
"city":"San Francisco",
"mobile_url":"http://mobile.yelp.com/biz/yyqwqfgn1ZmbQYNbl7s5sQ",
"name":"Nickies",
"address2":"",
"avg_rating":4,
"latitude":37.772201,
"zip":"94117",
"address3":"",
anonymous
anonymous / c-array-iterate.cc
Created January 28, 2018 00:34
#include <iterator>
#include <iostream>
void
int_squares(int c[5])
{
// won't work because the size of the array is not available
// when passed to a function because it is treated as a pointer
std::cerr << "auto it : ..." << '\n';
function u() {
requestAnimationFrame(u);
g = p ?
audio.currentTime * 60 : (
audio = "RIFFdataWAVEfmt " + atob("EAAAAAEAAQAAeAAAAHgAAAEACAA") + "data",
b.style.background = "radial-gradient(circle,#345,#000)",
b.style.position = "fixed",
b.style.height = b.style.width = "100%",
@alaingalvan
alaingalvan / sobol.cpp
Last active June 4, 2020 06:14
Sobol Quasi-Random Sequence Generation by Dr. John Burkardt. Forked to not use cout errors, use less dimensions (saving code size)
/**
* Sobol Noise Generation
* GNU LGPL license
* By Dr. John Burkardt (Virginia Tech)
* https://gist.github.com/alaingalvan/af92ddbaf3bb01f5ef29bc431bd37891
*/
//returns the position of the high 1 bit base 2 in an integer n
int getHighBit1(int n)
{
@jonhoo
jonhoo / README.md
Last active July 19, 2021 10:49
Distributed RWMutex in Go
@wrouesnel
wrouesnel / .remote-backup-excludes.txt
Last active September 5, 2021 23:32
A script for performing a remote backup to another server using rsync and bup for versioning.
# this is an rsync-excludes format list of files to exclude.
@virtualritz
virtualritz / building_rust_wrappers_on_docs_rs.md
Last active April 22, 2022 17:38
Making Rust FFI Wrapper Crates Build on Docs.rs

TLDR;

Check for env::var("DOCS_RS") in your build.rs and omit linking if it is set.

Where to find this: read the complete About section on docs.rs.

Long Version

If you’ve written wrapper crates, e.g. using bindgen, you may have ran into this. You have:

@ssylvan
ssylvan / rh_hash_table.hpp
Last active January 12, 2023 04:52
Quick'n'dirty Robin Hood hash table implementation. Note, I have implemented this algorithm before, with tons of tests etc. But *this* code was written specifically for the blog post at http://sebastiansylvan.com/post/robin-hood-hashing-should-be-your-default-hash-table-implementation/, it has not been extensively tested so there may be bugs (an…
#define USE_ROBIN_HOOD_HASH 1
#define USE_SEPARATE_HASH_ARRAY 1
template<class Key, class Value>
class hash_table
{
static const int INITIAL_SIZE = 256;
static const int LOAD_FACTOR_PERCENT = 90;
struct elem
@kristopolous
kristopolous / hn_seach.js
Last active July 24, 2023 04:12
hn job query search
// Usage:
// Copy and paste all of this into a debug console window of the "Who is Hiring?" comment thread
// then use as follows:
//
// query(term | [term, term, ...], term | [term, term, ...], ...)
//
// When arguments are in an array then that means an "or" and when they are seperate that means "and"
//
// Term is of the format:
// ((-)text/RegExp) ( '-' means negation )
@michael-k
michael-k / git-lfs-diff.sh
Created June 26, 2015 10:22
Git LFS Diff
#!/bin/sh
if [ $# -ne 3 ] ; then
echo "Usage: $0 <ref> <ref> <filename>"
exit 1
fi
RevA=$1
RevB=$2
File=$3