Skip to content

Instantly share code, notes, and snippets.

// http://github.com/ride/go-migrate
type MigrationHandler func(context *migrate.Context) error
type core.Migration struct {
Up: MigrationHandler,
Down: MigrationHandler,
Name: "Something cool",
}
package main
import (
. "github.com/smartystreets/goconvey/convey"
"sync"
"testing"
)
var mutex sync.Mutex
#include <iostream>
#include <locale>
#include <regex>
using namespace std;
class Node {
public:
Node(const string& name) : name(name) {
cout << "grid " << this->name << " initialized" << endl;
//
// AppDelegate.m
// testNotifications
//
// Created by Johan Ride on 12/4/14.
// Copyright (c) 2014 Ride.com. All rights reserved.
//
#import "AppDelegate.h"
if defined?(ActiveSupport)
ActiveSupport.on_load(:action_controller) do
include AnalyticsHelper
end
end
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
require 'minitest_helper'
require 'action_controller'
class ControllerStuff < ActionController::Base
def create
local_activity.action("yay!")
end
end
class ControllerStuffTest < ActionController::TestCase
@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
@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 / 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);