Skip to content

Instantly share code, notes, and snippets.

Unhandled Exception: System.OutOfMemoryException: Out of memory
at (wrapper managed-to-native) object:__icall_wrapper_mono_array_new_specific (intptr,int)
at System.IO.MemoryStream.set_Capacity (Int32 value) [0x00000] in <filename unknown>:0
at System.IO.MemoryStream.Expand (Int32 newSize) [0x00000] in <filename unknown>:0
at System.IO.MemoryStream.Write (System.Byte[] buffer, Int32 offset, Int32 count) [0x00000] in <filename unknown>:0
at com.mosso.cloudfiles.domain.response.CloudFilesResponse.CopyToMemory (System.IO.Stream input, System.IO.Stream output) [0x00000] in <filename unknown>:0
at com.mosso.cloudfiles.domain.response.CloudFilesResponse..ctor (System.Net.HttpWebResponse webResponse) [0x00000] in <filename unknown>:0
at com.mosso.cloudfiles.domain.request.CloudFilesRequest.GetResponse () [0x00000] in <filename unknown>:0
at com.mosso.cloudfiles.domain.ResponseFactory.Create (ICloudFilesRequest request) [0x00000] in <filename unknown>:0
at com.mosso.cloudfiles.domain.request.
@JCallicoat
JCallicoat / mixin.js
Created November 23, 2011 23:32
Mixin objects in Javascript
Object.prototype.mixin = function(module, overwrite)
{
for (var property in module)
{
if (overwrite || !this.hasOwnProperty(property))
{
this[property] = module[property];
}
}
}
@JCallicoat
JCallicoat / thread_first.rb
Created April 10, 2012 00:50
Clojure's -> in Ruby (not that you'd ever really do it :P)
#!/usr/bin/ruby
# http://clojuredocs.org/clojure_core/clojure.core/-%3E
# http://clojuredocs.org/clojure_core/clojure.core/-%3E%3E
def thread_first(val, *args)
args.inject(val) { |acc, arg|
if val.is_a? Hash
acc = acc[arg]
else
@JCallicoat
JCallicoat / gist:3855876
Created October 9, 2012 00:44
fabric + sh??? winning!
from sh import ls
from fabric.api import run, env
env.hosts = ['localhost', 'rightfootin.info']
def test():
print(ls('/')) # runs on every item in env.hosts
@JCallicoat
JCallicoat / gist:3877163
Created October 12, 2012 03:41
Go thing
package main
import "net/http"
import "fmt"
func hello(w http.ResponseWriter, r *http.Request) {
contentType := w.Header().Get("Content-Type")
if contentType == "application/json" {
fmt.Fprintln(w, `{"Hello": "JSON"}`)
} else {
Images Talk
- Who are we?
Rackspace Private Cloud. We install and operate Openstack clusters, both locally in our datacenters, and remotely in customer datacenters.
<pending>Reference Alamo v3?</pending>
- What are we talking about?
@JCallicoat
JCallicoat / gist:4709916
Created February 4, 2013 21:35
Refried beans
#!/bin/bash
# REFRIED BEANS
# 'soft' rekick a rcps environment
echo "PURGING THE BEANS"
apt-get -y purge `dpkg -l | awk '/mysql/ {print $2}'`
apt-get -y purge `dpkg -l | awk '/keystone/ {print $2}'`
#!/usr/bin/env ruby
class ArrayWithHashes
def initialize(hashes)
@hashes = hashes
end
def find_by(selector)
hashes = []
#!/usr/bin/env ruby
class ArrayWithHashes
def initialize(hashes)
@hashes = hashes
end
def find_by(selector)
@hashes.select do |h|
@JCallicoat
JCallicoat / regex-golf.clj
Created January 7, 2014 09:25
Translation of the first part of Norvig's solution to xkcd 1313 to clojure
(use '[clojure.string :only [split, join]])
(use '[clojure.set :only [difference]])
(def winners
(let [w "washington adams jefferson jefferson madison madison monroe
monroe adams jackson jackson vanburen harrison polk taylor pierce buchanan
lincoln lincoln grant grant hayes garfield cleveland harrison cleveland mckinley
mckinley roosevelt taft wilson wilson harding coolidge hoover roosevelt
roosevelt roosevelt roosevelt truman eisenhower eisenhower kennedy johnson nixon
nixon carter reagan reagan bush clinton clinton bush bush obama obama"]