Skip to content

Instantly share code, notes, and snippets.

Christian Sousa neocsr

Block or report user

Report or block neocsr

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View clojure.md

Setting Up Clojure on OS X

I spent a lot of time trying to find a pretty optimal (for me) setup for Clojure… at the same time I was trying to dive in and learn it. This is never optimal; you shouldn't be fighting the environment while trying to learn something.

I feel like I went through a lot of pain searching Google, StackOverflow, blogs, and other sites for random tidbits of information and instructions.

This is a comprehensive "what I learned and what I ended up doing" that will hopefully be of use to others and act as a journal for myself if I ever have to do it again. I want to be very step-by-step and explain what's happening (and why) at each step.

Step 1: Getting Clojure (1.3)

@neocsr
neocsr / CustomView.rb
Created Jun 7, 2013
Random context drawing in RubyMotion
View CustomView.rb
class CustomView < UIView
def gradient
if @gradient
puts "Reusing gradient..."
else
puts "Creating gradient..."
colors = Pointer.new(:float, 8)
colors[0], colors[1] = 0.0/255.0, 1.0
colors[2], colors[3] = 125.0/255.0, 1.0
View pusher.scala
// Implementing the publishing Pusher REST API
// @see http://pusher.com/docs/rest_api
// with Play (scala) Framework
// @see http://scala.playframework.org/
class Pusher {
val appId = Play.configuration.getProperty("pusher.appId")
val key = Play.configuration.getProperty("pusher.key")
val secret = Play.configuration.getProperty("pusher.secret")
@neocsr
neocsr / get_out_of_my_controller_spec.rb
Created Dec 8, 2012 — forked from adomokos/get_out_of_my_controller_spec.rb
The supporting code for my blog entry: "Get out of my Controller! And from Active Record, too!"
View get_out_of_my_controller_spec.rb
module ActiveRecord; class Base; end; end
# The AR Models Rails give you
class User < ActiveRecord::Base
# These fields are defined dynamically by ActiveRecord
attr_accessor :id, :full_name
end
class Discussion < ActiveRecord::Base
# These fields are defined dynamically by ActiveRecord
@neocsr
neocsr / DateTimeJavaScriptConverter.cs
Created Oct 12, 2012 — forked from johnnyreilly/DateTimeJavaScriptConverter.cs
The 3 elements needed to have a nice JavaScriptSerializer DateTime experience in older browsers and using ASP.NET WebForms
View DateTimeJavaScriptConverter.cs
using System;
using System.Collections;
using System.Collections.Generic;
using System.Web.Script.Serialization;
namespace MyNamespace
{
/// <summary>
/// A custom DateTime JavaScriptConverter courtesy of these good folks: http://blog.calyptus.eu/seb/2011/12/custom-datetime-json-serialization/
/// Using this forces DataTimes to be serialised as ISO 8601 rather "\/Date(1249335477787)\/" style
@neocsr
neocsr / xkcdify.m
Created Oct 9, 2012
XKCDIFY! Redraw existing Matlab axes in an XKCD style
View xkcdify.m
function xkcdify(axHandle)
%XKCDIFY redraw an existing axes in an XKCD style
%
% XKCDIFY( AXES ) re-renders all childen of AXES to have a hand drawn
% XKCD style, http://xkcd.com, AXES can be a single axes or a vector of axes
%
% NOTE: Only plots of type LINE and PATCH are re-rendered. This should
% be sufficient for the majority of 2d plots such as:
% - plot
% - bar
@neocsr
neocsr / heroku.rake
Created Oct 2, 2012 — forked from myronmarston/heroku.rake
Rake task to download a sql dump from a heroku app
View heroku.rake
namespace :heroku do
def app_name
@app_name ||= Heroku::Command::BaseWithApp.new([]).app
end
def latest_bundle(timeout = 30)
puts "Attempting to get latest bundle..."
get_bundle = lambda do
bundles = Heroku::Command.run('bundles', {})
bundles.sort { |b1, b2| b1[:created_at] <=> b2[:created_at] }
@neocsr
neocsr / install_graphite_statsd_ubuntu_precise.sh
Created Sep 28, 2012 — forked from bhang/install_graphite_statsd_ubuntu_precise.sh
Install Graphite and statsd on Ubuntu 12.04 LTS (Precise Pangolin)
View install_graphite_statsd_ubuntu_precise.sh
#!/bin/bash
# node.js using PPA (for statsd)
sudo apt-get install python-software-properties
sudo apt-add-repository ppa:chris-lea/node.js
sudo apt-get update
sudo apt-get install nodejs npm
# Install git to get statsd
sudo apt-get install git
@neocsr
neocsr / graphite.md
Created Sep 28, 2012 — forked from caged/graphite.md
Installing Graphite on OS X Lion
View graphite.md

This is a general overview (from memory) of the steps I used to install graphite (http://graphite.wikidot.com) on OS X Lion. I think the steps are in order but YMMV. Please fork and fix if you find an error.

Install Python 2.7.2

brew install python

Check your env

$ python --version
@neocsr
neocsr / graphite.md
Created Sep 28, 2012 — forked from surjikal/graphite.md
Installing Graphite on OS X Lion
View graphite.md

Follow these steps to install graphite on OS X Lion.

Prerequisites

  • Python 2.7
  • Brew
  • Git

Install dependencies

Install Cairo

You can’t perform that action at this time.