Skip to content

Instantly share code, notes, and snippets.

Alan Andrade alan-andrade

Block or report user

Report or block alan-andrade

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
@alan-andrade
alan-andrade / ActiveRecord.md
Last active Dec 21, 2015
My notes on trying to understand how Active record works.
View ActiveRecord.md

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 Dec 24, 2015
Ideas para el Rails Rumble
View Karmapoints.md

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
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
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'
}).create();
var keys = Ember.keys(beer);
deepEqual(keys, ['type']);
});
View id.rs
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 Aug 29, 2015
integrate Rust with C
View id.rs
// 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,
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
View facts_and_fallacies.md

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).

View codereview.md

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.

View how-to-not-change-code.md

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.

You can’t perform that action at this time.