Skip to content

Instantly share code, notes, and snippets.

View alan-andrade's full-sized avatar
💻

Alan Andrade alan-andrade

💻
View GitHub Profile
@alan-andrade
alan-andrade / ActiveRecord.md
Last active December 21, 2015 15:18
My notes on trying to understand how Active record works.

ActiveRecord 3.2

Base

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
alan-andrade / Karmapoints.md
Last active December 24, 2015 05:19
Ideas para el Rails Rumble

Karma points

Analizar repositorios contra sentiments API. : ) Community Karma

curl -u "alanandrade" https://api.github.com/repos/marqeta/marqeta.com/pulls/comments?since=2013-09-20T20:24:26Z
curl https://api.github.com/repos/alanandrade/embeddable-chats/comments
@alan-andrade
alan-andrade / pacer.m
Created November 9, 2013 21:20
XCode gists
- (void) testStartPacer{
[self.pacer onStart:^{
STAssertTrue([self.pacer isRunning], @"Timer should be running after calling start method");
}]
[self.pacer start];
}
@alan-andrade
alan-andrade / keys.js
Last active December 28, 2015 09:29
emberjs test
test('should contain properties declared in the extension', function () {
var beer = Ember.Object.extend({
type: 'ipa'
}).create();
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
alan-andrade / id.rs
Last active August 29, 2015 13:56
integrate Rust with C
// The C method signature is as follows:
int
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,
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.