Skip to content

Instantly share code, notes, and snippets.

View i8degrees's full-sized avatar

Jeffrey Carpenter i8degrees

View GitHub Profile
#!/usr/bin/env ruby
# Note filing system implemented via many-to-many relation sharing tags
CREATE TABLE notes (note_id INT UNSIGNED NOT NULL AUTO_INCREMENT, # Primary key => note.note_id
note VARCHAR(255) NOT NULL,
PRIMARY KEY (note_id))
# ENGINE=InnoDB;
# (3NF) Notes <-> Tags mapping / routing implementation; no worries of data duplication / debris being left behind
CREATE TABLE mappings (map_id INT UNSIGNED NOT NULL AUTO_INCREMENT, # Primary key => mapping.map_id
@i8degrees
i8degrees / skel.rb
Created February 4, 2012 07:03
OptParse Skel
#!/usr/bin/env ruby
#
# ~/Projects/homnom/nomnom-v0.2/tmp/cmdline-args.rb:jeff
#
# Preliminary play with a new input arguments parser for much enhanced
# console-level control of our I/O scripts.
#
# Usage:
#
# http://ruby-doc.org/stdlib-1.9.3/libdoc/optparse/rdoc/OptionParser.html
...and so without any background info aside, (doesn't really matter), I
start off around 10-11 PM on Saturday eve finishing up on some random sys admin
crap, and decide that I wanted to see how well FileVault (encryption) worked
and so here comes the next mini-nightmare that would take me the next 24 hours
to get back to where I last left off. I thought this was going to be a 30-min
job (the length of time it took for FileVault to encrypt).
A long, drawn out story made shorter, FileVault doesn't play very well with
multiple partitions, nor does Time Machine like it overly too much either as I
found out. (Although if one is willing to lose the ability to browse through the
@i8degrees
i8degrees / github_feed
Created April 22, 2012 10:26
GitHub Feed for i8degrees
#!/bin/sh
#
# Github Feed for i8degrees
#
URL="https://github.com/i8degrees.atom"
if [ $# -eq 1 ] ; then
headarg=$(( $1 * 2 ))
else
@i8degrees
i8degrees / allegro5.rb
Created March 13, 2013 05:20
allegro5.0.9 homebrew formula
require 'formula'
class Allegro5 < Formula
homepage 'http://www.allegro.cc'
url 'http://downloads.sourceforge.net/project/alleg/allegro/5.0.9/allegro-5.0.9.tar.gz'
sha1 '7d05bc3d59b60a22796e9938f0b9a463c33d4b30'
depends_on 'cmake' => :build
depends_on 'libvorbis' => :optional
depends_on 'freetype' => :optional
@i8degrees
i8degrees / Makefile (OSX).sublime-build
Created March 14, 2013 18:35
~/Library/Application Support/Sublime Text 2/Packages/User
{
"cmd": ["make"],
"file_regex": "^(..[^:]*):([0-9]+):?([0-9]+)?:? (.*)$",
"working_dir": "${project_path:${folder:${file_path}}}",
"selector": "source.makefile",
"path": "/usr/bin:/usr/local/bin:/Applications/Xcode.app/Contents/Developer/usr/bin",
"variants":
[
{
@i8degrees
i8degrees / card.h
Last active December 15, 2015 20:29
Final Draft of TTcards Card Objects Design
class Card
{
unsigned int id;
unsigned int level; // 1..10
unsigned int type;
unsigned int element;
unsigned int power[4]; // clockwise; top, right, down, left
std::string name;
// Card ( id, level, type, element, power[], name );
@i8degrees
i8degrees / .bashlib_timecap
Created April 9, 2013 12:47
timecap() mod
# Derives from Fielding's dotfiles repo
# https://github.com/justfielding/dotfiles
timecap () {
filenumber=${1:-1}
delay=${2:-5}
scdir=${3:-./}
date_bin=$(which date)
screencap_bin="$(which screencapture)"
i=$filenumber
while [ 1 ]
class DrawableObject
{
public:
virtual void Draw(GraphicalDrawingBoard&) const = 0; //draw to GraphicalDrawingBoard
};
class Triangle : public DrawableObject
{
public:
void Draw(GraphicalDrawingBoard&) const; //draw a triangle
@i8degrees
i8degrees / CMakeLists.txt
Created May 5, 2013 21:56
elle CMake Build Script
cmake_minimum_required ( VERSION 2.6 )
set ( CMAKE_VERBOSE_MAKEFILE true )
set ( CMAKE_BUILD_TYPE Debug )
#set ( BUILD_SHARED_LIBS true )
#set ( CMAKE_OSX_ARCHITECTURES i386;x86_64 ) # OSX Universal Library
set ( CMAKE_CXX_COMPILER "/usr/bin/clang++" )
set ( CMAKE_CXX_FLAGS "-std=c++11 -stdlib=libc++" )
set ( CMAKE_CXX_FLAGS_DEBUG "-gfull -O0 -Wall" )