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
ORG 0 | |
LOAD X / LOAD X into AC | |
ADD Y / ADD Y to AC | |
STORE Z / STORE AC in Z | |
LOAD Z / LOAD Z into AC | |
OUTPUT / OUTPUT AC | |
X, DEC 1 / variable declaration | |
Y, DEC 2 / variable declaration |
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
var UInt4 = function (value) { | |
return (value & 0xF); | |
}; | |
var Int4 = function (value) { | |
var ref = UInt4(value); | |
return (ref > 0x7) ? ref - 0x10 : ref; | |
}; | |
var UInt8 = function (value) { |
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
#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
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
import os | |
from shutil import copyfile | |
library_string = "" | |
root = "src" | |
header = (".h", ".hpp") | |
impl = (".c", ".cc", ".cpp") | |
variables = [] |
OlderNewer