Skip to content

Instantly share code, notes, and snippets.

View berkus's full-sized avatar
🎯
Practice your desensitization exercises to remain unfazed by enemy atrocities

Berkus Decker berkus

🎯
Practice your desensitization exercises to remain unfazed by enemy atrocities
View GitHub Profile
@berkus
berkus / gist:7694240
Created November 28, 2013 16:08
PeerPicker crash
Process: PeerPicker [5146]
Path: /Users/USER/*/PeerPicker.app/Contents/MacOS/PeerPicker
Identifier: ???
Version: 0
Code Type: X86-64 (Native)
Parent Process: fish [32818]
Responsible: iTerm [31942]
User ID: 501
Date/Time: 2013-11-28 18:07:07.736 +0200
@berkus
berkus / gist:7909968
Created December 11, 2013 12:57
Portable bitcoin wallet on OSX From http://bitcoin.stackexchange.com/a/8851

This is what worked for me on MAC OS 10.6.8 with Bitcoin-Qt 0.8.1-beta. I'm combining and editing the Pygmy script and Nick ODells answer, there were a few typos.

Also note, I opened the application with right-click >> "Show Package Contents" and then edited the files with the finder, and TextWrangler. No Terminal required!

  1. Create new directory in Bitcoin-Qt.app/Contents/Resources and name it data

  2. Navigate up a level and then open the MacOS folder

  3. In that folder, create a new file called start.sh

@berkus
berkus / gist:8225683
Created January 2, 2014 20:01
Working with GitHub pull requests from git

From http://www.somethingorothersoft.com/2012/05/22/pulling-github-pull-requests-with-git/

Fetch all Pull Requests (even closed ones)

Just execute the following commands and you'll be able to fetch all pull requests by simply executing git fetch pr. Pull requests will be stored in a remote as individual remote branches. So a pull request 123 will be accessible as 'pr/123':

git remote add pr https://github.com/upstream/repo.git
git config --local --unset remote.pr.fetch
git config --local --add remote.pr.fetch "+refs/pull/*/head:refs/remotes/pr/*"
@berkus
berkus / gist:8271468
Created January 5, 2014 17:49
Custom implementation of `any` class.
// From http://stackoverflow.com/questions/6122094/building-boostoptions-from-a-string-boostany-map/6123962#6123962
#include <boost/program_options.hpp>
#include <typeinfo>
#include <stdexcept>
namespace po = boost::program_options;
class any_option
{
#define BOOST_TEST_MODULE Test1
#include <boost/test/unit_test.hpp>
#include <string>
char IfaceData[]
= { 23, 0, 0, 0,
5, 0, 0, 0, 'H', 'e', 'l', 'l', 'o',
5, 0, 0, 0, 'W', 'o', 'r', 'l', 'd',
1, 0, 0, 0, '!' };
@berkus
berkus / CMakeLists.txt
Created April 3, 2014 13:52
Competition winner from Twitter image encoding challenge - http://stackoverflow.com/questions/891643/twitter-image-encoding-challenge
CMAKE_MINIMUM_REQUIRED( VERSION 2.4 )
PROJECT( nanocrunch )
ADD_EXECUTABLE( nanocrunch nanocrunch.cpp )
INCLUDE( FindImageMagick )
FIND_PACKAGE( ImageMagick COMPONENTS Magick++ )
IF( ImageMagick_FOUND )
INCLUDE_DIRECTORIES( ${ImageMagick_INCLUDE_DIRS} )
TARGET_LINK_LIBRARIES( nanocrunch ${ImageMagick_LIBRARIES} )
app-admin/logrotate clang
app-admin/sudo clang
app-admin/syslog-ng clang
app-arch/bzip2 clang
app-arch/cpio clang
app-arch/file-roller clang
app-arch/gzip clang
app-arch/lha clang
app-arch/libarchive clang
app-arch/lz4 clang
#include <iostream>
using namespace std;
class VirtBase
{
public:
virtual void test() = 0;
};
class Derived : public VirtBase
@berkus
berkus / build.sh
Last active August 29, 2015 14:01
Clang EFI PECOFF problem
../toolchain/clang/bin/clang
-target i686-pc--coff
-I./include -I/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.9.sdk/usr/include
-std=c++11
-ffreestanding
-fno-stack-protector
-fpic
-fshort-wchar
-fno-exceptions
-Wall -Wextra -Wno-unused-private-field -Wno-ignored-attributes
@berkus
berkus / gist:4f3a6d1a25ccfddceedf
Last active August 29, 2015 14:02
Get class name in libclang.py See http://szelei.me/code-generator/ for details.
for c in translation_unit.cursor.get_children():
if (c.kind == clang.cindex.CursorKind.CLASS_DECL):
className = c.spelling