Skip to content

Instantly share code, notes, and snippets.

View danhedron's full-sized avatar
🦀

Daniel Evans danhedron

🦀
View GitHub Profile
cmake_minimum_required(VERSION 3.19)
project(foo)
add_library(foo_lib STATIC
FooLib.c
)
add_executable(foo_app Foo.c
)
diff --git a/tests/test_AudioLoading.cpp b/tests/test_AudioLoading.cpp
index ea4bf54a..0aa9fd59 100644
--- a/tests/test_AudioLoading.cpp
+++ b/tests/test_AudioLoading.cpp
@@ -23,6 +23,9 @@ BOOST_AUTO_TEST_CASE(testBufferIsPlaying) {
sound.play();
BOOST_REQUIRE(sound.isPlaying() == true);
+ sound.play();
+ BOOST_REQUIRE(sound.isPlaying() == true);
'use strict';
let fs = require ('fs')
let EventEmitter = require ('events')
class FileTail extends EventEmitter {
constructor(fileName, options) {
super();
this.readBytes = 0;
let self = this;
function fup
scp $argv <<<SSH Destination goes here>>>
echo <<<Public Domain goes here>>>/(basename $argv) | xclip -i -selection PRIMARY
end
import httplib, json, sys, re
def get_module_errors( connection, module ):
connection.request( 'GET', '/w/api.php?action=paraminfo&format=json&modules=%s' % module )
resp = connection.getresponse()
data = json.loads(resp.read())
errors = {}
for error in data['paraminfo']['modules'][0]['errors']:
errors[error['code']] = error['info']
return errors
# coding=utf-8
Te = 0
Tr = 1
Tw = 2
def gen_row(size, row = 0):
return [Te] * (size-1 if row%2 else size)
def gen_board(size):
f = lambda x: gen_row(size, x)
javascript:(function(){function c(){var e=document.createElement("link");e.setAttribute("type","text/css");e.setAttribute("rel","stylesheet");e.setAttribute("href",f);e.setAttribute("class",l);document.body.appendChild(e)}function h(){var e=document.getElementsByClassName(l);for(var t=0;t<e.length;t++){document.body.removeChild(e[t])}}function p(){var e=document.createElement("div");e.setAttribute("class",a);document.body.appendChild(e);setTimeout(function(){document.body.removeChild(e)},100)}function d(e){return{height:e.offsetHeight,width:e.offsetWidth}}function v(i){var s=d(i);return s.height>e&&s.height<n&&s.width>t&&s.width<r}function m(e){var t=e;var n=0;while(!!t){n+=t.offsetTop;t=t.offsetParent}return n}function g(){var e=document.documentElement;if(!!window.innerWidth){return window.innerHeight}else if(e&&!isNaN(e.clientHeight)){return e.clientHeight}return 0}function y(){if(window.pageYOffset){return window.pageYOffset}return Math.max(document.documentElement.scrollTop,document.body.scrollTop)}funct
@danhedron
danhedron / .gitignore
Created September 18, 2012 11:01
Java Refresher
*.class
@danhedron
danhedron / gist:3352067
Created August 14, 2012 19:38
Smoothing.
['x','y','z'].forEach((function(d) {
this.movement[d] += (this.moveTarget[d] - this.movement[d]) * dt;
}).bind(this));
[1 0 0 0
0 1 0 0
0 0 1 0
x y z 1]