Skip to content

Instantly share code, notes, and snippets.

View beanieboi's full-sized avatar

Ben Fritsch beanieboi

View GitHub Profile
clang++ -DETLOG -std=c++0x -pedantic -Wall -I./backtrace/ -g0 -O3 -std=c++11 -stdlib=libc++ -o backtrace/libs/backtrace/src/backtrace.o -c backtrace/libs/backtrace/src/backtrace.cpp
In file included from backtrace/libs/backtrace/src/backtrace.cpp:10:
./backtrace/boost/backtrace.hpp:62:21: error: implicit instantiation of undefined template 'std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >'
std::string trace_line(unsigned frame_no) const
^
/usr/bin/../lib/c++/v1/iosfwd:187:27: note: template is declared here
class _LIBCPP_VISIBLE basic_string;
^
In file included from backtrace/libs/backtrace/src/backtrace.cpp:10:
./backtrace/boost/backtrace.hpp:65:24: error: implicit instantiation of undefined template 'std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >'
@beanieboi
beanieboi / gist:4988048
Created February 19, 2013 17:37
asset deployment with ruby on rails and rsync only if they changed
before 'deploy:create_symlink', 'deploy:upload_assets'
before 'deploy:update_code', 'deploy:compress_assets'
after 'deploy:update_code', 'deploy:custom_symlink'
namespace :deploy do
desc "symlinks"
task :custom_symlink do
run "ln -nfs #{shared_path}/assets #{release_path}/public/assets"
end
@beanieboi
beanieboi / gist:4298395
Created December 15, 2012 19:25
pipofant.c
#include <stdint.h>
#include <unistd.h>
#include <stdio.h>
#include <stdlib.h>
#include <fcntl.h>
#include <string.h>
#include <sys/ioctl.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <linux/types.h>
@beanieboi
beanieboi / ruby_install.sh
Last active October 11, 2015 08:48
compile ruby from scratch
#!/usr/bin/env bash
aptitude -y update
aptitude -y install build-essential zlib1g-dev libssl-dev libreadline6-dev libyaml-dev
cd /tmp
wget http://ftp.ruby-lang.org/pub/ruby/1.9/ruby-1.9.3-p392.tar.gz
tar -xvzf ruby-1.9.3-p392.tar.gz
cd ruby-1.9.3-p392/
./configure --prefix=/opt/ruby-1.9.3-p392
make -j 4
make install
@beanieboi
beanieboi / chef_solo_bootstrap.sh
Created October 2, 2012 11:15 — forked from ryanb/chef_solo_bootstrap.sh
Bootstrap Chef Solo
#!/usr/bin/env bash
apt-get -y update
apt-get -y install build-essential zlib1g-dev libssl-dev libreadline6-dev libyaml-dev
cd /tmp
wget ftp://ftp.ruby-lang.org/pub/ruby/1.9/ruby-1.9.3-p194.tar.gz
tar -xvzf ruby-1.9.3-p194.tar.gz
cd ruby-1.9.3-p194/
./configure --prefix=/opt/ruby-1.9.3-p194
make
make install
{
"color_scheme": "Packages/User/Tomorrow-Night-Bright.tmTheme",
"ensure_newline_at_eof_on_save": true,
"folder_exclude_patterns":
[
".svn",
".git",
".hg",
"CVS",
".sass-cache"
history | awk {'print $2, $3, $4'} | sort | uniq -c | sort -k1 -rn | head -n 30
@beanieboi
beanieboi / progress_indicators.rb
Created August 12, 2012 18:02 — forked from jpo/progress_indicators.rb
Ruby CLI Progress Indicators
# Terminal Progress Indicators. Four examples are included: percentage,
# spinner, progress bar, and combined. This script has been tested on
# Mac OS X 10.8 with Ruby 1.8.7, 1.9.1, 1.9.2, and 1.9.3
class Spinner
include Enumerable
def each
loop do
yield '|'
yield '/'
file = File.new(File.join(Rails.root, 'extras', 'bson', 'foobar.bson')
while not file.eof? do
entry = BSON.read_bson_document(file)
entry.delete("_id")
Entry.create(entry)
end