Skip to content

Instantly share code, notes, and snippets.

View instrumented.cpp
#include "instrumented.hpp"
// necessary static initialization -- this needs to be done for each type we want to instrument
template<> size_t instrumented<short>::comparison_count = 0;
template<> size_t instrumented<int>::comparison_count = 0;
template<> size_t instrumented<float>::comparison_count = 0;
template<> size_t instrumented<double>::comparison_count = 0;
View keybase.md

Keybase proof

I hereby claim:

  • I am bosmacs on github.
  • I am bosmacs (https://keybase.io/bosmacs) on keybase.
  • I have a public key whose fingerprint is 5B71 EF92 7991 D15E E420 0E0C 0428 5F56 C4FC BAA5

To claim this, I am signing this object:

View CocoaScript.podspec
Pod::Spec.new do |s|
s.name = "CocoaScript"
s.version = "1.0"
s.summary = "CocoaScript is a scripting language for Mac OS X built on top of JavaScript, with a bridge to Apple's Cocoa libraries. You can use it to communicate with other applications just like AppleScript does."
s.homepage = "http://jstalk.org"
s.license = "MIT"
s.author = {"Gus Mueller" => "gus@flyingmeat.com"}
s.source = {:git => "http://github.com/ccgus/cocoascript.git"}
s.source_files = "src/framework/**/*.{h,m}"
s.prefix_header_file = 'src/framework/CocoaScript_Prefix.pch'
@bosmacs
bosmacs / gist:4561371
Created Jan 18, 2013
OpenCTM podspec
View gist:4561371
Pod::Spec.new do |s|
s.name = "openctm"
s.version = "1.0.3"
s.summary = "Library for reading/writing compressed triangle mesh (CTM) files."
s.homepage = "http://openctm.sourceforge.net"
s.license = "zlib/libpng"
s.author = {"Marcus Geelnard" => "marcus256@users.sourceforge.net"}
s.source = {:http => "http://downloads.sourceforge.net/project/openctm/OpenCTM-#{s.version}/OpenCTM-#{s.version}-src.tar.bz2"}
s.source_files = "lib/**/*.{h,c}"
end
@bosmacs
bosmacs / GLSL.plist
Created Dec 13, 2012
BBEdit Codeless Language Module for GLSL
View GLSL.plist
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN"
"http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<!-- The smallest CLM that will color keywords.
Copyright (c) 2012 Bare Bones Software, Inc. -->
<dict>
<!-- You must identify the plist as a CLM: -->
@bosmacs
bosmacs / gist:3156052
Created Jul 21, 2012
set org-babel default compilers
View gist:3156052
;; set default compiler
(setq org-babel-C-compiler "clang")
(setq org-babel-C++-compiler "clang++")
@bosmacs
bosmacs / gist:3155904
Created Jul 21, 2012
org-mode latex listings
View gist:3155904
;; export code as listings
(setq org-export-latex-listings t)
;; customize latex packages for syntax highlighting
(require 'org-latex)
(add-to-list 'org-export-latex-packages-alist '("" "listings"))
(add-to-list 'org-export-latex-packages-alist '("" "color"))
@bosmacs
bosmacs / private_access.cpp
Created Jun 6, 2012 — forked from dabrahams/private_access.cpp
Accessing Private Data
View private_access.cpp
#include <iostream>
// This is a rewrite and analysis of the technique in this article:
// http://bloglitb.blogspot.com/2010/07/access-to-private-members-thats-easy.html
// ------- Framework -------
// The little library required to work this magic
// Generate a static data member of type Tag::type in which to store
// the address of a private member. It is crucial that Tag does not
@bosmacs
bosmacs / gist:2499834
Created Apr 26, 2012
Check CGL for software fallback
View gist:2499834
GLint gpuVertex, gpuFragment;
CGLGetParameter(CGLGetCurrentContext(), kCGLCPGPUVertexProcessing, &gpuVertex);
CGLGetParameter(CGLGetCurrentContext(), kCGLCPGPUFragmentProcessing, &gpuFragment);
View C99 Complex type
#include <stdio.h>
#include <complex.h>
int main() {
_Complex unsigned int c = 4ju;
printf("%f", cimagf(c));
}