Skip to content

Instantly share code, notes, and snippets.

View nicolashohm's full-sized avatar

Nicolas Hohm nicolashohm

View GitHub Profile
@nicolashohm
nicolashohm / ffs_in_file.c
Created August 5, 2016 22:10
find first set in file
#include<stdio.h>
int main(int argc, char *argv[]) {
printf("Start reading...\n");
FILE *fp = fopen(argv[1], "r");
int res = 0, buff = 0, ffs = 0, pos = 0;
while (fread(&buff, sizeof(int), 1, fp) == 1) {
ffs = __builtin_ffs(buff);
@nicolashohm
nicolashohm / Vagrantfile
Created June 3, 2017 20:22
Vagrant bento centos with npm
# -*- mode: ruby -*-
# vi: set ft=ruby :
# All Vagrant configuration is done below. The "2" in Vagrant.configure
# configures the configuration version (we support older styles for
# backwards compatibility). Please don't change it unless you know what
# you're doing.
Vagrant.configure("2") do |config|
# The most common configuration options are documented and commented below.
# For a complete reference, please see the online documentation at
@nicolashohm
nicolashohm / composer.json
Last active June 11, 2018 12:45
The Empty Framework
{
"name": "nickel715/empty",
"description": "",
"license": "MIT",
"authors": [
{ "name": "Nicolas Hohm" }
],
"autoload": {
"files": ["empty.php"]
}
@nicolashohm
nicolashohm / assert.sas
Last active October 28, 2023 14:22
Assert methods like they exist in test frameworks for SAS
%macro assertEquals(expected, actual, message);
%if &expected ne &actual %then %do;
%put ERROR: Failed asserting that &actual is equal to &expected - &message;
%end;
%mend;
* Asserts that the value returned by the query in actual is equals to the expectation;
%macro assertSqlEquals(expected, query, message);
proc sql noprint;
&query;