Skip to content

Instantly share code, notes, and snippets.

View CamonZ's full-sized avatar

Rafael Simon Garcia CamonZ

View GitHub Profile
@CamonZ
CamonZ / rename-component.md
Created October 6, 2016 18:07 — forked from paridin/rename-component.md
Ember rename component, shell helper

Rename a component file.

I made a mistake to naming some components, I don't want to erase it and create again, the problem is, I need to rename the files by hand, it's a boring task, and maybe in the future I will get the same issue, to make me the life easier I developed the following snippet, you should use it if you have the same problem.

The snippet

#!/usr/bin/env bash
# purpose: rename files, in same path
@CamonZ
CamonZ / README.md
Last active August 29, 2015 14:11 — forked from mbostock/.block
@CamonZ
CamonZ / multisort-omp-leaf.c
Created December 4, 2013 15:03
Recursive paralelized code for multisort using leaf and tree paralelization strategies
#include <malloc.h>
#include <stdio.h>
#include <stdlib.h>
#include <omp.h>
#if _EXTRAE_
#include "extrae_user_events.h"
#endif
#if _TAREADOR_
#include <tareador_hooks.h>
#endif
@CamonZ
CamonZ / selector.rb
Created November 23, 2012 13:09
HTML::Selector
def has_an_nth_child_match?(statement, values, pseudo)
# Nth-child including last and of-type.
res = statement.sub!(/^:nth-(last-)?(child|of-type)\((odd|even|(\d+|\?)|(-?\d*|\?)?n([+\-]\d+|\?)?)\)/) do |match|
reverse = $1 == "last-"
of_type = $2 == "of-type"
@source << ":nth-#{$1}#{$2}("
case $3
when "odd"
pseudo << nth_child(2, 1, of_type, reverse)
@source << "odd)"
@CamonZ
CamonZ / gist:4135047
Created November 23, 2012 10:40
rvm test
[~/Code] ➔ type rvm | head -n 1
rvm is a function
$(document).ready(function() {
function fillCalendar(rota_days) {
/* fubar */
for ( i = 0; i < rota_days.length; i++) {
rota_day = rota_days[0];
console.log(rota_days);
/* doing stuffs with rota_day */
$('td.day-'+ rota_day.day +' hospital-' + rota_day.hospital)
}
}
class RotaDay < ActiveRecord::Base
attr_accessible :day, :hospital_id
belongs_to :hospital
end
@CamonZ
CamonZ / cookie.rb
Created November 15, 2012 02:28
Strange behaviour
@CamonZ
CamonZ / README.md
Created August 28, 2012 18:40 — forked from mbostock/.block
How-To: Update a Pie Chart (Part 2)

Test with hashes instead of raw data; also, less data on the second set

@CamonZ
CamonZ / centers_parser.rb
Created August 24, 2012 17:05
Parse CNE Voting Centers data into json
#!/usr/bin/env ruby -wKU
require 'csv'
require 'iconv'
require 'active_support/inflector'
require 'json'
COLUMN_NAMES = {
"state_code" => 0,
"state_name" => 1,