Skip to content

Instantly share code, notes, and snippets.

View bithavoc's full-sized avatar

Johan Hernandez bithavoc

View GitHub Profile
Error executing command build: Range violation
Full exception: core.exception.RangeError@dub.generators.generator(117): Range violation
----------------
dub(_d_array_bounds+0x26) [0x6c9ba2]
dub() [0x62f9b1]
dub(_D3dub10generators9generator16ProjectGenerator7collectMFS3dub10generators9generator17GeneratorSettingsC3dub8package_7PackageKHAyaS3dub10generators9generator16ProjectGenerator10TargetInfoxHAyaAyaKAAyaZS3dub9compilers8compiler13BuildSettings14__foreachbody7MFKAyaKxS3dub10dependency10DependencyZi+0x423) [0x62de87]
dub(_aaApply2+0x6a) [0x6cb97a]
dub(dub.compilers.compiler.BuildSettings dub.generators.generator.ProjectGenerator.collect(dub.generators.generator.GeneratorSettings, dub.package_.Package, ref dub.generators.generator.ProjectGenerator.TargetInfo[immutable(char)[]], const(immutable(char)[][immutable(char)[]]), ref immutable(char)[][])+0x679) [0x62d90d]
dub(_D3dub10generators9generator16ProjectGenerator7collectMFS3dub10generators9generator17GeneratorSettingsC3dub8package_7PackageKHAyaS3dub10genera
@bithavoc
bithavoc / fileImport.d
Created March 25, 2014 05:01
Compile-Time file import in D
import std.stdio;
template loadFile(string filePath, string accessorName) {
const char[] loadFile = "@property string " ~ accessorName ~ "() { return \"" ~ import(filePath) ~ "\";}";
}
mixin(loadFile!("hello.txt", "contentOfHelloDotTxt"));
void main()
{
writeln(contentOfHelloDotTxt);
@bithavoc
bithavoc / fix_ios8_datepicker.mm
Created September 25, 2014 00:04
Fix iOS8 UI datepicker issue.
// https://medium.com/@bithavoc/uidatepicker-presentation-issue-on-ios-8-98215118a27f
if(NSFoundationVersionNumber > NSFoundationVersionNumber_iOS_7_1) {
[[UITableView appearanceWhenContainedIn:[UIDatePicker class], nil] setBackgroundColor:nil]; // for iOS 8
} else {
[[UITableViewCell appearanceWhenContainedIn:[UIDatePicker class], [UITableView class], nil] setBackgroundColor:[UIColor colorWithWhite:0.0 alpha:0.0]]; // for iOS 7
}
@bithavoc
bithavoc / output.sh
Created November 17, 2014 16:31
capturing stack traces in go
/opt/boxen/homebrew/Cellar/go/1.3.3/libexec/src/pkg/runtime/proc.c:1445 runtime - goexit
/opt/boxen/homebrew/Cellar/go/1.3.3/libexec/src/pkg/runtime/proc.c:247 runtime - main
/Users/ride/src/going/src/github.com/ride/teste/main.go:67 main - main
/Users/ride/src/going/src/github.com/ride/teste/main.go:72 main - level1
/Users/ride/src/going/src/github.com/ride/teste/main.go:76 main - level2
/Users/ride/src/going/src/github.com/ride/teste/main.go:80 main - level3
/opt/boxen/homebrew/Cellar/go/1.3.3/libexec/src/pkg/runtime/panic.c:248 runtime - panic
Error recovered: shit went wrong
require 'minitest_helper'
require 'action_controller'
class ControllerStuff < ActionController::Base
def create
local_activity.action("yay!")
end
end
class ControllerStuffTest < ActionController::TestCase
Process: Google Chrome [22511]
Path: /Applications/Google Chrome.app/Contents/MacOS/Google Chrome
Identifier: com.google.Chrome
Version: 39.0.2171.71 (2171.71)
Code Type: X86-64 (Native)
Parent Process: ??? [1]
Responsible: Google Chrome [22511]
User ID: 501
Date/Time: 2014-12-02 12:26:25.922 -0500
if defined?(ActiveSupport)
ActiveSupport.on_load(:action_controller) do
include AnalyticsHelper
end
end
//
// AppDelegate.m
// testNotifications
//
// Created by Johan Ride on 12/4/14.
// Copyright (c) 2014 Ride.com. All rights reserved.
//
#import "AppDelegate.h"
#include <iostream>
#include <locale>
#include <regex>
using namespace std;
class Node {
public:
Node(const string& name) : name(name) {
cout << "grid " << this->name << " initialized" << endl;
package main
import (
. "github.com/smartystreets/goconvey/convey"
"sync"
"testing"
)
var mutex sync.Mutex