Skip to content

Instantly share code, notes, and snippets.

@kirbysayshi
kirbysayshi / LICENSE
Last active October 13, 2024 04:03
Hierarchical Spatial Hash Grid: extremely efficient spatial hashing for collision detection between objects of any size! This is an implementation in JS as described in http://www10.informatik.uni-erlangen.de/~schornbaum/hierarchical_hash_grids.pdf
Copyright 2012 Andrew Petersen
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR O
@benjaminfisher
benjaminfisher / jQueryFallback.js
Last active April 13, 2018 01:27
Bullet proof jQuery CDN loading using head.js
<script>
head.js('http://code.jquery.com/jquery-1.9.1.min.js', function(){
if(typeof jQuery === 'undefined'){
head.js('js/lib/jquery/jquery-1.9.1.min.js');
};
})
</script>
@rodw
rodw / backup-github.sh
Last active November 9, 2024 17:55
A simple script to backup an organization's GitHub repositories, wikis and issues.
#!/bin/bash
# A simple script to backup an organization's GitHub repositories.
#-------------------------------------------------------------------------------
# NOTES:
#-------------------------------------------------------------------------------
# * Under the heading "CONFIG" below you'll find a number of configuration
# parameters that must be personalized for your GitHub account and org.
# Replace the `<CHANGE-ME>` strings with the value described in the comments
# (or overwrite those values at run-time by providing environment variables).
@wuhao5
wuhao5 / png_build.sh
Last active December 1, 2019 21:53
build libpng for iOS/MacOS X
rm -rf install_*
rm -rf output-*
# build simulator
./configure --prefix=`pwd`/install_i386 CFLAGS="-Ofast -mios-version-min=5.0" LDFLAGS="-flto" CC="xcrun -sdk iphonesimulator clang -arch i386"
make clean && make -j8 && make install
./configure --prefix=`pwd`/install_x86_64 CFLAGS="-Ofast -mios-version-min=5.0" LDFLAGS="-flto" CC="xcrun -sdk iphonesimulator clang -arch x86_64"
make clean && make -j8 && make install
@deadalusai
deadalusai / tasks.json
Last active September 12, 2024 17:53
VS Code tasks.json for Rust/Cargo
/*
Before using this tasks.json you may like to consider trying one of the following VS Code extensions:
rust-analyzer
Marketplace: https://marketplace.visualstudio.com/items?itemName=matklad.rust-analyzer
Source: https://github.com/rust-analyzer/rust-analyzer
rls
Marketplace: https://marketplace.visualstudio.com/items?itemName=rust-lang.rust
Source: https://github.com/rust-lang/rls-vscode
@luckylooke
luckylooke / cellAutoVoronoi.js
Last active October 6, 2017 00:01
Rewriten library cellauto to make it work on diagrams generated by Raymond Hill voronoi library( https://github.com/gorhill/Javascript-Voronoi )
// rewriten from http://sanojian.github.io/cellauto/
function CellAutoVoronoiCell(index) {
this.index = index;
this.delays = [];
}
CellAutoVoronoiCell.prototype.process = function(neighbors) {
return;
};
@clarkjones
clarkjones / HaxeScript.hx
Last active July 12, 2018 19:55 — forked from jasononeil/HaxeScript.hx
haxex, a short shell script that can be used so you have Haxe shell scripting
#!/usr/bin/env haxex -lib mcli @
/**
Taken from mcli example https://github.com/waneck/mcli
Say hello.
Example inspired by ruby's "executable" lib example
**/
class HaxeScript extends mcli.CommandLine
{
/**
#!/usr/bin/env bash
# https://code.google.com/p/chromium/issues/detail?id=226801
url='https://chromium.googlesource.com/chromium/src/net/+/master/http/transport_security_state_static.json?format=TEXT';
curl -#s "${url}" | \
base64 --decode | \
sed '/^ *\/\// d' | \
sed '/^\s*$/d' > hsts.json;
@mschuwalow
mschuwalow / backup-github.sh
Last active May 31, 2024 23:23 — forked from rodw/backup-github.sh
A simple script to backup an organization's GitHub repositories, wikis and issues. Using full_name instead of name and dropping all org stuff.
#!/bin/bash
# A simple script to backup an organization's GitHub repositories.
# NOTE: if you have more than 100 repositories, you'll need to step thru the list of repos
# returned by GitHub one page at a time, as described at https://gist.github.com/darktim/5582423
GHBU_BACKUP_DIR=${GHBU_BACKUP_DIR-"<backup-dir>"} # where to place the backup files
GHBU_UNAME=${GHBU_UNAME-"<username>"} # the username of a GitHub account (to use with the GitHub API)
GHBU_PASSWD=${GHBU_PASSWD-"<password>"} # the password for that account
@xanecs
xanecs / _elementaryOS_on_C720.md
Last active July 12, 2021 17:02
elementaryOS Loki on Acer Chromebook C720

This guide will show you how to install and configure elementaryOS Loki on your Acer C720 or C720p. I'm assuming you have installed some sort of Linux on your Chromebook before and already know your way around in Developer Mode. If not, read and follow https://www.chromium.org/chromium-os/developer-information-for-chrome-os-devices/acer-c720-chromebook sections "Developer Mode" and "Legacy Boot".

Installation

Nothing special here: Download the ISO from https://elementary.io (put in $0 as an amount to download the ISO for free, although you should consider donating)