Skip to content

Instantly share code, notes, and snippets.

Avatar

Ben Fritsch beanieboi

View GitHub Profile
View gist:84b0b86238952e6636c9
# For more information visit the GitHub documentation: https://github.com/krausefx/deliver
# Everything next to a # is a comment and will be ignored
# hide_transporter_output # remove the '#' in the beginning of the line, to hide the output while uploading
########################################
# App Metadata
########################################
@beanieboi
beanieboi / gist:4bf04221c20b48c0fe99
Created Dec 6, 2014
Download Redbull - Day of my Youth
View gist:4bf04221c20b48c0fe99
rtmpdump --rtmp rtmp://cp250155.edgefcs.net/ondemand/ --playpath mp4:media/2635130829001/201411/3772/2635130829001_3908406916001_MI201405170001-mpeg-4-hd-high-1080p-8mbits.mp4 -o redbull.mp4
@beanieboi
beanieboi / gist:c1ce1eedec6236aceeba
Created Oct 18, 2014
segfault lxc-snapshot in LXC 1.0.5 on Ubuntu Trusty
View gist:c1ce1eedec6236aceeba
lxc-snapshot --name=railsonfire -r snap0
Segmentation fault (core dumped)
Program received signal SIGSEGV, Segmentation fault.
0x00007ffff7bb8851 in lxcapi_snapshot_restore (c=0x55555575a3b0, snapname=0x7fffffffe8f9 "snap0", newname=0x0) at lxccontainer.c:3089
3089 bdev = bdev_init(c->lxc_conf->rootfs.path, c->lxc_conf->rootfs.mount, NULL);
@beanieboi
beanieboi / fetch_vs_or.md
Last active Aug 29, 2015
Benchmarking fetch vs [] in Ruby
View fetch_vs_or.md
Calculating -------------------------------------
hash containing key using fetch with block
                         56342 i/100ms
hash containing key using [] with ||
                         63758 i/100ms
-------------------------------------------------
hash containing key using fetch with block
                      1600812.5 (±25.4%) i/s -    6592014 in   5.013939s
hash containing key using [] with ||
@beanieboi
beanieboi / 1_proc_yield.md
Last active Aug 29, 2015
Benchmarking block.call vs yield
View 1_proc_yield.md
Calculating -------------------------------------
              &block     19651 i/100ms
               yield     25992 i/100ms
-------------------------------------------------
              &block   361821.1 (±31.2%) i/s -    1316617 in   5.001739s
               yield 11423477091.4 (±27.9%) i/s - 21463829712 in   3.010145s

Comparison:
               yield: 11423477091.4 i/s
View flatmap_bench.md

The Benchmark

Calculating -------------------------------------
       map + flatten      1927 i/100ms
            flat_map      2603 i/100ms
-------------------------------------------------
       map + flatten    19876.1 (±9.2%) i/s -     100204 in   5.086854s
            flat_map 74241008.8 (±18.8%) i/s -  312185599 in   4.754152s

Comparison:
View gist:c0ce74ac81b9d75ab659
18/05/14 20:02:25,552 Tweetbot[421]: (
0 CoreFoundation 0x00007fff8ce2925c __exceptionPreprocess + 172
1 libobjc.A.dylib 0x00007fff8b75de75 objc_exception_throw + 43
2 CoreFoundation 0x00007fff8ce2910c +[NSException raise:format:] + 204
3 AppKit 0x00007fff943c8797 _NSBlockNumberForIndex + 85
4 AppKit 0x00007fff943cb3f1 -[NSLayoutManager textContainerForGlyphAtIndex:effectiveRange:] + 274
5 AppKit 0x00007fff9454d71c -[NSTextView drawsVerticallyForCharacterAtIndex:] + 198
6 AppKit 0x00007fff9454d63e -[NSTextInputContext drawsVerticallyForCharacterAtIndex:] + 41
7 AppKit 0x00007fff9454d5d6 -[NSTextInputContext remapsArrowKeysForVerticalOrientation] + 76
8 AppKit 0x00007fff9452dca9 -[NSKeyBindingManager(NSKeyBindingManager_MultiClients) interpretEventAsCo
@beanieboi
beanieboi / gist:10373044
Last active Aug 29, 2015
Librato Sign Ups
View gist:10373044
wrong:
divide([sum(s("prod.myapp.signups", "*"), sum(s("prod.myapp.cancels", "*")))])
fixed:
divide([sum(s("prod.myapp.signups", "*")), sum(s("prod.myapp.cancels", "*"))])
View gist:5543088
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 Feb 19, 2013
asset deployment with ruby on rails and rsync only if they changed
View gist:4988048
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