Skip to content

Instantly share code, notes, and snippets.

-- discipline + punish
--
-- four outputs (subjects) process input 1 through randomized transfer functions (disciplines)
-- a trigger in input 2 selects a subject based on a fifth, secret discipline,
-- and punishes it, altering its transfer function
function rand10vpp()
return math.random() * 10 - 5
end
@benschwarz
benschwarz / pg.md
Last active December 15, 2020 04:20
Awesome postgres
@jasongilman
jasongilman / atom_clojure_setup.md
Last active January 11, 2024 09:13
This describes how I setup Atom for Clojure Development.

Atom Clojure Setup

This describes how I setup Atom for an ideal Clojure development workflow. This fixes indentation on newlines, handles parentheses, etc. The keybinding settings for enter (in keymap.cson) are important to get proper newlines with indentation at the right level. There are other helpers in init.coffee and keymap.cson that are useful for cutting, copying, pasting, deleting, and indenting Lisp expressions.

Install Atom

Download Atom

The Atom documentation is excellent. It's highly worth reading the flight manual.

This document is my personal writeup of trying to make sense of all the clojure(script) tooling chain. It might contain errors and it actually contains a few questions

Tooling:

Nomenclature/Terminology

REPL: A prompt in its simples form.

  1. Waits for and Reads input,
@ialhashim
ialhashim / fitting3D.cpp
Created November 14, 2014 23:17
Fitting 3D points to a plane or a line
template<class Vector3>
std::pair<Vector3, Vector3> best_plane_from_points(const std::vector<Vector3> & c)
{
// copy coordinates to matrix in Eigen format
size_t num_atoms = c.size();
Eigen::Matrix< Vector3::Scalar, Eigen::Dynamic, Eigen::Dynamic > coord(3, num_atoms);
for (size_t i = 0; i < num_atoms; ++i) coord.col(i) = c[i];
// calculate centroid
Vector3 centroid(coord.row(0).mean(), coord.row(1).mean(), coord.row(2).mean());
@quark-zju
quark-zju / lodash.hpp
Last active February 5, 2020 02:14
Little C++ header inspired by Ruby and Lo-dash
// compile with -std=c++1y
#include <algorithm>
#include <functional>
#include <iterator>
#include <vector>
namespace LoDash {
using std::begin;
@RyanScottLewis
RyanScottLewis / _schema.rb
Created June 22, 2012 05:45
SpineJS User's Name helper + showing off getters/setters in Spine
ActiveRecord::Schema.define(:version => 00000000000000) do
create_table "users", :force => true do |t|
t.string "username", :default => "", :null => false
t.string "email", :default => "", :null => false
t.string "encrypted_password", :default => "", :null => false
# Devise fluff here...
t.string "first_name", :default => "", :null => false
@rakhmad
rakhmad / clojure.md
Created April 17, 2012 15:55
Setting Up Clojure on OS X

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)

@simme
simme / Install_tmux
Created October 19, 2011 07:55
Install and configure tmux on Mac OS X
# First install tmux
brew install tmux
# For mouse support (for switching panes and windows)
# Only needed if you are using Terminal.app (iTerm has mouse support)
Install http://www.culater.net/software/SIMBL/SIMBL.php
Then install https://bitheap.org/mouseterm/
# More on mouse support http://floriancrouzat.net/2010/07/run-tmux-with-mouse-support-in-mac-os-x-terminal-app/
@satoruhiga
satoruhiga / ofxSimpleParticleSystem.h
Created September 29, 2011 14:06
ofxSimpleParticleSystem
#pragma once
#include "ofMain.h"
#include <tr1/array>
/*
// EXAMPLE
#include "testApp.h"
#include "ofxSimpleParticleSystem.h"