Skip to content

Instantly share code, notes, and snippets.

void test(std::vector<int> test)
{
for (const auto t : test)
{
std::cout << t << std::endl;
}
}
int main()
{
#
# refind.conf
# Configuration file for the rEFInd boot menu
#
# Timeout in seconds for the main menu screen. Setting the timeout to 0
# disables automatic booting (i.e., no timeout). Setting it to -1 causes
# an immediate boot to the default OS *UNLESS* a keypress is in the buffer
# when rEFInd launches, in which case that keypress is interpreted as a
# shortcut key. If no matching shortcut is found, rEFInd displays its
{
"aria2": {
"args": [
"--no-conf",
"--allow-overwrite=true",
"--always-resume=false",
"--auto-file-renaming=false",
"--check-integrity=true",
"--conditional-get=true",
"--continue=true",
#!/bin/bash
declare -a servers
cd /home/zerophase
servers=($(reflector -p rsync -f 30 -l 20 -p 20 --sort rate | grep -o 'rsync:\/\/.*'))
declare -i i=0
regex='^[[:blank:]]+\"rsync://.*'
( IFS='\n'
while read -r line
@Zerophase
Zerophase / powerpill.data
Created June 14, 2016 21:16
Exmple json file
{
"aria2": {
"args": [
"--no-conf",
"--allow-overwrite=true",
"--always-resume=false",
"--auto-file-renaming=false",
"--check-integrity=true",
"--conditional-get=true",
"--continue=true",
@Zerophase
Zerophase / xml_parser.cpp
Last active May 27, 2016 17:52
TinyXML2 segfault
c = content->FirstChildElement("Connection");
while(dialogues[0] != nullptr) // rewrite to iterate to the next dialogue
{
if(c->FirstChildElement("Source")->Attribute("IdRef", rightTarget.front().c_str()))
connectionNodes.push_back(c);
if(c != nullptr)
c = c->NextSiblingElement("Connection");
if(c == nullptr)
{
/home/zerophase/.icons/Windows8/gtk-3.0/gtk-widgets-assets-dark.css
/home/zerophase/.icons/Windows8/gtk-3.0/assets/slider-vert-insensitive-dark.png
/home/zerophase/.icons/Windows8/gtk-3.0/assets/slider-vert-over-dark.png
/home/zerophase/.icons/Windows8/gtk-3.0/assets/menuitem-checkbox-checked-insensitive.png
/home/zerophase/.icons/Windows8/gtk-3.0/assets/radio-selected-over.png
/home/zerophase/.icons/Windows8/gtk-3.0/assets/slider-horiz.png
/home/zerophase/.icons/Windows8/gtk-3.0/assets/slider-horiz-over-dark.png
/home/zerophase/.icons/Windows8/gtk-3.0/assets/menuitem-radio-checked-selected.png
/home/zerophase/.icons/Windows8/gtk-3.0/assets/checkbox-checked-over.png
/home/zerophase/.icons/Windows8/gtk-3.0/assets/radio-selected.png
public class Sweep
{
AABBIntersection aabbIntersection = new AABBIntersection();
private AABB3D b = new AABB3D();
public bool TestMovingAABB(AABB3D b0, Vector3 d, float time0, float time1,
AABB3D b1, ref float time)
{
float mid = (time0 + time1) * 0.5f;
float midTest = mid - time0;
@Zerophase
Zerophase / gist:fa6d3241ecb2cf67ac0f
Last active August 29, 2015 14:16
Physics Director
public class PhysicsDirector : Director
{
private List<MovablePhysicsMediator> movablePhysicsMediators = new List<MovablePhysicsMediator>();
private List<Ground> grounds = new List<Ground>();
private Vector3 gravity = new Vector3(0f, -30f, 0f);
private AABBIntersection aabbIntersection = new AABBIntersection();
private AABB3D playerBoundingBox;
@Zerophase
Zerophase / gist:4b40e9aa6ba81bfc6204
Last active August 29, 2015 14:16
AABB Intersection
public class AABBIntersection
{
public bool Intersect(AABB3D a, AABB3D b)
{
if (Math.Abs(a.Center.x - b.Center.x) > (a.HalfWidth + b.HalfWidth))
return false;
if (Math.Abs(a.Center.y - b.Center.y) > (a.HalfHeight + b.HalfHeight))
return false;
if (Math.Abs(a.Center.z - b.Center.z) > (a.HalfDepth + b.HalfDepth))
return false;