Skip to content

Instantly share code, notes, and snippets.

@sinfante
sinfante / gist:b6fedc67aa5008e0b3c2
Created August 3, 2015 16:41
TogglCrash 08-03-2015
Process: TogglDesktop [531]
Path: /Applications/TogglDesktop.app/Contents/MacOS/TogglDesktop
Identifier: com.toggl.toggldesktop.TogglDesktop
Version: 7.2.199 (7.2.199)
Code Type: X86-64 (Native)
Parent Process: ??? [1]
Responsible: TogglDesktop [531]
OS Version: Mac OS X 10.10.4 (14E46)
Report Version: 11
@sinfante
sinfante / sra2n64save.cpp
Last active August 13, 2019 21:38
N64 Emulators: C++ code to move an *.sra in-game save to the sixtyforce format *.n64save
#include <stdio.h>
#define SRAM_SIZE (32 * 1024)
static unsigned char SRAM[SRAM_SIZE];
int main(void)
{
FILE * stream;
register int i;
@sinfante
sinfante / time_distance_helper.rb
Created December 9, 2013 17:12
Helper to show distance between 2 DateTime.
module TimeDistanceHelper
def date_time_distance(start_date_time,end_date_time)
seconds_distance = (end_date_time - start_date_time).to_i.abs
days_distance = (seconds_distance / (3600 * 24)).to_i
seconds_distance -= days_distance * 3600 * 24
hours_distance = (seconds_distance / 3600).to_i
seconds_distance -= hours_distance * 3600
@sinfante
sinfante / migration.rb
Created December 4, 2013 20:50
Ruby on Rails seed for regions and counties ("comunas") of Chile with the required migrations.
class Migration < ActiveRecord::Migration
def change
create_table :countries do |t|
t.string :name
t.timestamps
end
create_table :regions do |t|
t.string :short_name