Skip to content

Instantly share code, notes, and snippets.

View skotzko's full-sized avatar

Andrew Skotzko skotzko

View GitHub Profile
@Aaronontheweb
Aaronontheweb / FriendsMaster.cs
Created June 1, 2015 18:42
Akka.NET Parent Actor "Create If Not Exist" pattern
/*
* From Petabridge's Akka.Remote training: https://petabridge.com/training/akka-remoting/
* Copyright Petabridge LLC, 2015.
*/
/// <summary>
/// Master actor responsible for the management of friends lists
/// </summary>
public class FriendsMaster : ReceiveActor
{
@jaimeiniesta
jaimeiniesta / setup_sumo_me.js.coffee
Created December 21, 2014 15:48
How to load SumoMe script in a turbolinks-friendly way
# Defines a namespace for my application
MyApplication = {}
# A way to pass a callback both to jQuery's "ready" and turbolinks' "page:load" events
MyApplication.onDocumentReady = (callback) ->
$(document).ready(callback)
$(document).on('page:load', callback)
# Defines a function to load the SumoMe script
MyApplication.load_sumome_script = (data_sumo_site_id) ->
@beccam
beccam / GettingStartedThree.py
Last active February 4, 2016 18:34
Getting Started with Apache Cassandra Part III (cqlengine)
from cqlengine import columns
from cqlengine.models import Model
class Users(Model):
firstname = columns.Text()
age = columns.Integer()
city = columns.Text()
email = columns.Text()
lastname = columns.Text(primary_key=True)
def __repr__(self):
from cassandra.cluster import Cluster
from cassandra.policies import (TokenAwarePolicy, DCAwareRoundRobinPolicy, RetryPolicy)
from cassandra.query import (PreparedStatement, BoundStatement)
cluster = Cluster(
contact_points=['127.0.0.1'],
load_balancing_policy= TokenAwarePolicy(DCAwareRoundRobinPolicy(local_dc='datacenter1')),
default_retry_policy = RetryPolicy()
)
session = cluster.connect('demo')
@hkhamm
hkhamm / installing_cassandra.md
Last active May 5, 2024 13:14
Installing Cassandra on Mac OS X

Installing Cassandra on Mac OS X

Install Homebrew

Homebrew is a great little package manager for OS X. If you haven't already, installing it is pretty easy:

ruby -e "$(curl -fsSL https://raw.github.com/Homebrew/homebrew/go/install)"
@shageman
shageman / resources
Created April 23, 2014 20:34
#cbra resources from @shageman #railsconf talk
#Rails sample app
github.com/shageman/the_next_big_thing
# Pivotal Labs blog posts on #cbra
http://pivotallabs.com/tag/rails-application-suites/
#Past presentations by Ben Smith and me(mostly on this topic)
confreaks.com/presenters/790-stephan-hagemann
confreaks.com/presenters/784-ben-smith
@vincentmac
vincentmac / sublime-text-osx-context-menu.md
Created September 25, 2013 18:03
Sublime Text OSX Context Menu

Add Sublime Text to OS X Context Menu

  • Open Automator
  • Create a new Service
  • Add a Run Shell Script action
  • Set input to Service receives selected files or folders in any application
  • Set the script action to /Applications/Sublime\ Text.app/Contents/SharedSupport/bin/subl -n $@
  • Set Pass input to as arguments
  • Save as Open in Sublime Text
@maxim
maxim / rails_load_path_tips.md
Last active April 13, 2023 13:28
How to use rails load paths, app, and lib directories.

In Rails 3

NOTE: This post now lives (and kept up to date) on my blog: http://hakunin.com/rails3-load-paths

If you add a dir directly under app/

Do nothing. All files in this dir are eager loaded in production and lazy loaded in development by default.

If you add a dir under app/something/

@wacko
wacko / gist:5577187
Last active January 6, 2024 07:31
SSH between Mac OS X host and Virtual Box guest

On Mac OS (host):

Shutdown your VM and do:

VirtualBox > Settings > Network > Add (you will get vboxnet0)

On a terminal ifconfig will show you new interface vboxnet0

VM's Settings > System > check "Enable I/O APIC." VM's Settings > Network > Adapter 2 > host-only vboxnet0