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 / 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,
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 / 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']);
});
@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 / 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 / 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).