Skip to content

Instantly share code, notes, and snippets.

alan-andrade /
Last active Dec 21, 2015
My notes on trying to understand how Active record works.

ActiveRecord 3.2


This class wraps all the other ActiveRecord Modules into one so that you can inherit from it and get a Class persisted by a DB.

One of the main things that happen when you Inherit from Base, is to check for STI (single table inheritance).

alan-andrade /
Last active Dec 24, 2015
Ideas para el Rails Rumble

Karma points

Analizar repositorios contra sentiments API. : ) Community Karma

curl -u "alanandrade"
View pacer.m
- (void) testStartPacer{
[self.pacer onStart:^{
STAssertTrue([self.pacer isRunning], @"Timer should be running after calling start method");
[self.pacer start];
alan-andrade / keys.js
Last active Dec 28, 2015
emberjs test
View keys.js
test('should contain properties declared in the extension', function () {
var beer = Ember.Object.extend({
type: 'ipa'
var keys = Ember.keys(beer);
deepEqual(keys, ['type']);
let mut groups: ~[libc::gid_t] = ~[];
let n_groups = unsafe { libc::getgroups(69, groups.as_mut_ptr()) };
id(25518,0x104579000) malloc: *** error for object 0x7fc449c04528: incorrect checksum for freed object - object was probably modified after being freed.
*** set a breakpoint in malloc_error_break to debug
Abort trap: 6
alan-andrade /
Last active Aug 29, 2015
integrate Rust with C
// The C method signature is as follows:
getgrouplist(const char *name, int basegid, int *groups, int *ngroups);
// My Rust extern block
extern {
fn getgrouplist(name: *libc::c_char,
basegid: libc::c_int,
View gist:f077a2e638763f53254f
There are two pieces of information that the local provider and this method
are interested on and therefore the duplication.
1. User subscription status
2. User brain area of focus (from the personalization survery, the most relevant brain area)
This data is used to figure out which "scriptId" should be returned in the
resulting string.
What seems confusing, is the name of the method. It implies that "scriptId" is

Facts and fallacies of sw eng.

This starts with management because most of the high-leverage, high-visibility things that happend in sw are about it. Failure and successes are attributed to management.

Good management is more important that good techonology

Use the power of being a peon. (ref. The power of peonage).


Code Reviews

Engineers know who will be reviewing their tasks before they begin. Upfront planning can help avoid iteration during review.

Follow a style guide.

App knowledge is distributed. the eng. should rely on teammates to make it happen.


Change code to... improve code. You Refactor.

When dealing with unreleased code, but not always.

Code that was written without tests, is basically free play when change is needed. You have to accept the downside of high probabilities of changing behavior.

You can move code arround without an specific goal but a somewhat defined idea that will hopefully clear out as you go.