This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
class MainClass | |
{ | |
// The Karnaugh map, also known as the K-map, is a method to simplify boolean algebra expressions. | |
public static void Main(string[] args) | |
{ | |
// kmap cells | |
var kmap = new bool[4]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var gulp = require('gulp'); | |
var coffee = require('gulp-coffee'); | |
// @NOTE compile coffeescript into javascript | |
gulp.task('coffee', function () { | |
gulp.src('./_coffee/**/*.coffee') | |
.pipe(coffee({bare: true})) | |
.pipe(gulp.dest('./js/')) | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Exit with nonzero exit code if anything fails | |
set -e | |
# set up some variables | |
SOURCE_BRANCH="<source_branch>" | |
TARGET_BRANCH="<target_branch"> | |
GITHUB_REF="github.com/<username>/<repo_name>.git" | |
NAME="<your_name>" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#pragma once | |
/** | |
* elisa: a small metaprogramming header. | |
* FIXME: code cleanup and comment, | |
*/ | |
namespace elisa { | |
template<class T> | |
using invoke = typename T::type; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#pragma once | |
// https://gist.github.com/gongzhitaao/7062087 | |
class Timer { | |
using clock_ = std::chrono::high_resolution_clock; | |
using milli_ = std::chrono::duration<double, std::milli>; | |
public: | |
Timer() : beg_(clock_::now()) {} | |
void reset() { beg_ = clock_::now(); } | |
double elapsed() const { | |
return std::chrono::duration_cast<milli_> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#pragma once | |
#define TEST(__condition) \ | |
if ((__condition)) { \ | |
printf("[PASSED]\t%s\n", #__condition); \ | |
} else { \ | |
printf("[FAILED]\t%s\n", #__condition); \ | |
} | |
#define TEST_THROW(__condition, __exception) \ | |
try { \ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import os | |
from fnmatch import fnmatch | |
# pretty useless if youre using git. | |
root = "./" | |
search = ["._*", ".DS_Store", ".AppleDouble", ".LSOverride"] | |
for (path, dirs, files) in os.walk(root): |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream> | |
#include "module.h" | |
class MyModule : public Module { | |
DECLARE_MODULE(Module::M_TYPE_ONE); | |
public: | |
MyModule() {} | |
}; | |
REGISTER_MODULE(MyModule); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// C/C++ | |
#include <fstream> | |
#include <iostream> | |
#include <math.h> | |
// OpenGL | |
#include "opengl.h" | |
// utility | |
#include "matrix4.h" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
static SQRegFunction reg[] = { | |
// I believe the main reason this fails is due to the arguments. | |
// but when looking at DXSquirrel (specifically DXSquirrel_Device.cpp) there's nothing special done about it. | |
{ "getData", wrap_getData, 2, _SC("ts") }, | |
{ "getTestData", wrap_getTestData, NULL, NULL }, | |
{ 0, 0 } | |
}; | |
int wrap_getData(SQVM* v) { |
OlderNewer