Skip to content

Instantly share code, notes, and snippets.

@cbeck88
cbeck88 / visit_at.cc
Last active August 26, 2015 23:17 — forked from lichray/visit_at.cc
Access tuple by runtime index
#include <tuple>
#include <type_traits>
template <int Low, int High, int Mid = (Low + High) / 2, typename = void>
struct _visit_at;
template <int Low, int High, int Mid>
struct _visit_at<Low, High, Mid, std::enable_if_t<(Low > High)>>
{
template <typename... T>
@cbeck88
cbeck88 / story_with_lua.cpp
Last active August 27, 2015 14:47
iterations of design for lua state (posted on stack overflow)
////////////////////////////////////////////////////
// First stab, very naively:
//
// Define lua environment
void init_lua(lua_State * L);
struct lua_environment {
data_structure_a a_;
data_structure_b b_;
@cbeck88
cbeck88 / gist:884f7f6d20415a8d7a1e
Created October 27, 2014 02:31
error log when trying to install fontconfig with linuxbrew
$ brew install fontconfig --debug --verbose
/home/chris/.linuxbrew/Library/brew.rb (Formulary::StandardLoader): loading /home/chris/.linuxbrew/Library/Formula/fontconfig.rb
/home/chris/.linuxbrew/Library/brew.rb (Formulary::StandardLoader): loading /home/chris/.linuxbrew/Library/Formula/pkg-config.rb
/home/chris/.linuxbrew/Library/brew.rb (Formulary::StandardLoader): loading /home/chris/.linuxbrew/Library/Formula/freetype.rb
/home/chris/.linuxbrew/Library/brew.rb (Formulary::StandardLoader): loading /home/chris/.linuxbrew/Library/Formula/libpng.rb
/home/chris/.linuxbrew/Library/brew.rb (Formulary::StandardLoader): loading /home/chris/.linuxbrew/Library/Formula/xz.rb
/home/chris/.linuxbrew/Library/Homebrew/build.rb (Formulary::FromPathLoader): loading /home/chris/.linuxbrew/Library/Formula/fontconfig.rb
/home/chris/.linuxbrew/Library/Homebrew/build.rb (Formulary::StandardLoader): loading /home/chris/.linuxbrew/Library/Formula/freetype.rb
/home/chris/.linuxbrew/Library/Homebrew/build.rb (Formulary::StandardLoad
@cbeck88
cbeck88 / gist:1730313897b1562f3488
Created October 27, 2014 02:43
0001-apply-part-of-https-github.com-Homebrew-linuxbrew-pu.patch
From 25adb09695b80f8fa81ac70110b466c0909dc87a Mon Sep 17 00:00:00 2001
From: Chris Beck <render787@gmail.com>
Date: Sun, 26 Oct 2014 21:50:44 -0400
Subject: [PATCH] apply part of https://github.com/Homebrew/linuxbrew/pull/64
---
Library/Homebrew/extend/ENV/std.rb | 1 +
Library/Homebrew/requirements/x11_dependency.rb | 6 +++++-
2 files changed, 6 insertions(+), 1 deletion(-)
@cbeck88
cbeck88 / gist:b64d3c6497391e9e8580
Created October 27, 2014 05:37
errors when installing fontconfig, after adding lib png to make install command
$ brew install fontconfig --debug --verbose
/home/chris/.linuxbrew/Library/brew.rb (Formulary::StandardLoader): loading /home/chris/.linuxbrew/Library/Formula/fontconfig.rb
/home/chris/.linuxbrew/Library/brew.rb (Formulary::StandardLoader): loading /home/chris/.linuxbrew/Library/Formula/pkg-config.rb
/home/chris/.linuxbrew/Library/brew.rb (Formulary::StandardLoader): loading /home/chris/.linuxbrew/Library/Formula/freetype.rb
/home/chris/.linuxbrew/Library/brew.rb (Formulary::StandardLoader): loading /home/chris/.linuxbrew/Library/Formula/libpng.rb
/home/chris/.linuxbrew/Library/brew.rb (Formulary::StandardLoader): loading /home/chris/.linuxbrew/Library/Formula/xz.rb
/home/chris/.linuxbrew/Library/Homebrew/build.rb (Formulary::FromPathLoader): loading /home/chris/.linuxbrew/Library/Formula/fontconfig.rb
/home/chris/.linuxbrew/Library/Homebrew/build.rb (Formulary::StandardLoader): loading /home/chris/.linuxbrew/Library/Formula/freetype.rb
/home/chris/.linuxbrew/Library/Homebrew/build.rb (Formulary::StandardLoad
chris@chris-KLR650 ~ $ brew --config
HOMEBREW_VERSION: 0.9.5
ORIGIN: https://github.com/Homebrew/linuxbrew.git
HEAD: b6400242056b9e035c54fdb669c7b628fcbfef7f
Last commit: 2 hours ago
HOMEBREW_PREFIX: /home/chris/.linuxbrew
HOMEBREW_CELLAR: /home/chris/.linuxbrew/Cellar
CPU: quad-core 64-bit 6
OS X: 0-x86_64
Clang: 3.4 build 0
scons: Building targets ...
Install file: "wesnoth" as "/home/chris/w-bin/wesnoth"
InstallFilteredHook(["/home/chris/w-data/data"], ["data"])
InstallFilteredHook(["/home/chris/w-data/fonts"], ["fonts"])
InstallFilteredHook(["/home/chris/w-data/images"], ["images"])
InstallFilteredHook(["/home/chris/w-data/sounds"], ["sounds"])
scons: *** [/usr/local/share/doc] /usr/local/share/doc: Permission denied
scons: building terminated because of errors.
chris@chris-KLR650 ~ $ brew uninstall gobject-introspection
Uninstalling /home/chris/.linuxbrew/Cellar/gobject-introspection/1.42.0...
chris@chris-KLR650 ~ $ brew install gobject-introspection --debug --verbose
/home/chris/.linuxbrew/Library/brew.rb (Formulary::StandardLoader): loading /home/chris/.linuxbrew/Library/Formula/gobject-introspection.rb
/home/chris/.linuxbrew/Library/brew.rb (Formulary::StandardLoader): loading /home/chris/.linuxbrew/Library/Formula/xz.rb
/home/chris/.linuxbrew/Library/brew.rb (Formulary::StandardLoader): loading /home/chris/.linuxbrew/Library/Formula/pkg-config.rb
/home/chris/.linuxbrew/Library/brew.rb (Formulary::StandardLoader): loading /home/chris/.linuxbrew/Library/Formula/glib.rb
/home/chris/.linuxbrew/Library/brew.rb (Formulary::StandardLoader): loading /home/chris/.linuxbrew/Library/Formula/gettext.rb
/home/chris/.linuxbrew/Library/brew.rb (Formulary::StandardLoader): loading /home/chris/.linuxbrew/Library/Formula/libffi.rb
/home/chris/.linuxbrew/Library/Homebrew/build.rb
@cbeck88
cbeck88 / wesnoth.rb
Created October 29, 2014 14:02
fixup wesnoth homebrew script
require 'formula'
class Wesnoth < Formula
homepage 'http://www.wesnoth.org/'
url 'https://downloads.sourceforge.net/project/wesnoth/wesnoth-1.10/wesnoth-1.10.6/wesnoth-1.10.6.tar.bz2'
sha1 'c812a55a4544b894691f37ab95cc849d015a3041'
head 'https://github.com/cbeck88/wesnoth.git'
devel do
url 'https://downloads.sourceforge.net/project/wesnoth/wesnoth/wesnoth-1.11.7/wesnoth-1.11.7.tar.bz2'
@cbeck88
cbeck88 / wesnoth-new.rb
Last active August 29, 2015 14:08
new homebrew script for wesnoth, should work for os x and linux
require 'formula'
class WesnothNew < Formula
homepage 'http://www.wesnoth.org/'
url 'https://downloads.sourceforge.net/project/wesnoth/wesnoth-1.10/wesnoth-1.10.7/wesnoth-1.10.7.tar.bz2'
sha1 '86e329585244c377a1863f64dd534bc7bbcc7acf'
head 'https://github.com/wesnoth/wesnoth.git'
devel do
url 'https://downloads.sourceforge.net/project/wesnoth/wesnoth/wesnoth-1.11.19/wesnoth-1.11.19.tar.bz2'