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 <stdio.h> | |
#include <string.h> | |
#define MIN_CHARS 10 | |
int main(char *argv, int argc){ | |
int i, m = 10, f[3] = {0,1}; | |
for(i = MIN_CHARS; i > 2; i--){ | |
m *= 10; |
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 scala.collection.immutable.Map | |
/* | |
simple (uber-hacky) json renderer in 40 lines of scala | |
http://github.com/paulasmuth | |
usage: | |
JSONRenderer.render(Map( | |
"a_string" -> "fnord", |
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
package com.dawanda.recommender | |
import scala.collection.JavaConverters._ | |
import scala.collection.mutable.Buffer | |
import scala.io._ | |
import java.util.concurrent._ | |
class CSVReader[T <: Any](next: (Map[Symbol, Int] => T)){ | |
def read(file_path: String) : Buffer[T] = { |
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 | |
# This scripts sends a JSON message containing system health | |
# information to a fyrehose channel. | |
# | |
# Usage: | |
# $ ./linux_health_monitor.sh [host] [port] [channel] | |
# e.g. | |
# $ ./linux_health_monitor.sh localhost 2323 my_channel | |
# |
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
// FnordMetric Enterprise | |
// (c) 2011-2013 Paul Asmuth <[email protected]> | |
// | |
// Licensed under the MIT License (the "License"); you may not use this | |
// file except in compliance with the License. You may obtain a copy of | |
// the License at: http://opensource.org/licenses/MIT | |
package com.fnordmetric.enterprise | |
import scala.collection.mutable.ListBuffer |
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
// This file is part of the "LoveOS" project | |
// (c) 2013 DaWanda GmbH, Paul Asmuth <[email protected]>, et al. | |
// All rights reserved. | |
#include "plv.h" | |
#include "ruby.h" | |
VALUE loveos_render = Qnil; | |
// glue code to call the plv_load_json + plv_render methods from ruby |
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
; compile & run on OSX | |
; $ nasm -f macho -o /tmp/fnord.o fnord.asm | |
; $ ld -o /tmp/fnord /tmp/fnord.o | |
; $ /tmp/fnord | |
section .data | |
section .text | |
global start | |
start: |
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
/* | |
* This file is part of the "plgl" project | |
* (c) 2014 Paul Asmuth <[email protected]> | |
* | |
* All rights reserved. Please contact me to obtain a license. | |
*/ | |
#include <stdlib.h> | |
#include <stdio.h> | |
#include <math.h> | |
#include <plgl/engine.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
#!/usr/bin/env ruby | |
require "socket" | |
udp = UDPSocket.new | |
udp.bind('0.0.0.0', 8125) | |
targets = [ | |
["localhost", 8125], | |
["other.host.net", 8125] | |
] |
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
cmake_minimum_required(VERSION 2.6) | |
project(blahblah) | |
set(PROJ_SOURCES | |
src/a.cc | |
src/b.cc) | |
if(APPLE) | |
set(CMAKE_CXX_FLAGS "-std=c++0x -stdlib=libc++ ${CMAKE_CXX_FLAGS}") | |
else() |