Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

View msanroman's full-sized avatar
📈
1% better every day

Mike San Román msanroman

📈
1% better every day
View GitHub Profile
@msanroman
msanroman / plugins.vim
Created April 14, 2022 19:46
Neovim Plugin list
" ===========================
" PLUGINS
" ===========================
call plug#begin('~/.vim/plugged')
" === Editing Plugins === "
"
" .editorconfig
Plug 'editorconfig/editorconfig-vim'
$(document).ready(function() {
var womenSliderStarted = false;
var width = $(window).width();
$("#mujeres").click(function () {
$("#men_slider").hide();
$("#women_slider").show();
if( !womenSliderStarted ) {
if (width >= 1023) {
new Slider(
"#women_slider",
@msanroman
msanroman / links-popups.js
Created May 21, 2015 11:45
Vincular click con mostrar un popup... dentro de otro popup
@msanroman
msanroman / RomanNumerals.coffee
Created October 17, 2013 10:06
Software Craftsmanship Barcelona 2013 - Transformation Priority Premise [Roman Numerals Kata]
should = require 'should'
class ArabicToRomanConversions
conversions:
[
{ arabic: 1, roman: 'I'},
{ arabic: 4, roman: 'IV'},
{ arabic: 5, roman: 'V'},
{ arabic: 9, roman: 'IX'},
should = require 'should'
class ArabicToRoman
constructor: ->
@CONVERSIONS = [
{'roman': 'M', 'arabic': 1000},
{'roman': 'CM', 'arabic': 900},
{'roman': 'D', 'arabic': 500},
{'roman': 'CD', 'arabic': 400},
@msanroman
msanroman / gist:4725921
Created February 6, 2013 21:14
Smells mapped to SOLID principles

#SMELLS

  • Código duplicado: SRP
  • Métodos largos: SRP
  • Clases grandes: SRP
  • Listas de parámetros: DIP
  • Cambio divergente: SRP
  • Shotgun surgery: SRP
  • Envidia: SRP
  • Grupos/grumos de datos: OCP
  • Demasiadas primitivas: OCP
@msanroman
msanroman / tested.php
Created July 3, 2012 13:54
tdd-ed code
public function findMetasFor($photo = null) {
if ($photo != null)
return $this->findMetasForShow($photo);
else return $this->findMetasForCategory();
}
private function findMetasForCategory() {
if ($this->category != null)
return $this->metainformation[$this->category];
else return $this->metainformation["all_{$this->locale}"];
public function findMetasFor($photo = null) {
$locale = $this->localization->getCurrentLocale();
if ($photo == null) {
if($this->category == null)
return $this->metainformation['all_'.$locale];
else {
return $this->metainformation[$this->category];
}
} else {
$metas = $this->metainformation['shots_'.$locale];
#include <stdio.h>
#include <stdlib.h>
#include "sudoku_lib.h"
#if _SSGRIND_
#include <ss_valgrind.h>
#endif
#if _EXTRAE_
#include "extrae_user_events.h"
#endif
@msanroman
msanroman / gist:2782104
Created May 24, 2012 15:04
Second sum_vector
void sum_vector (int *X, int n)
{
int sum = 0;
int i;
int slice = n/OMP_get_num_threads();
vector<int> threads(n);
for (int i = 0; i < OMP_get_num_threads(); ++i)
{
#pragma omp task
threads[i] = sum_slice(X, i*slice, (i+1)*slice);