Skip to content

Instantly share code, notes, and snippets.

View ElMassimo's full-sized avatar
🎵

Máximo Mussini ElMassimo

🎵
View GitHub Profile
<snippet>
<content><![CDATA[
import { createMatcher } from '@support/MatchersHelper'
export default createMatcher('${TM_FILEPATH/.*?(\w+).js/\1/}', {
// Selectors: Semantic aliases for elements, a very useful abstraction.
selectors: {$1
},
// Getters: A convenient way to get nested elements in the component.
getters: {$2
@ElMassimo
ElMassimo / sublime_config.json
Last active September 10, 2018 18:34
Maximo's Sublime Config
{
"always_show_minimap_viewport": true,
"auto_complete": false,
"bold_folder_labels": true,
"color_scheme": "Packages/Material Theme/schemes/Material-Theme-Darker.tmTheme",
"draw_white_space": "none",
"ensure_newline_at_eof_on_save": true,
"find_selected_text": true,
"font_face": "Fira Code",
"font_face": "Fira Code",
@ElMassimo
ElMassimo / capybara_test_helper.sublime-snippet
Last active October 29, 2018 12:43
Capybara Test Helper - Snippet for Sublime Text
<snippet>
<content><![CDATA[
# frozen_string_literal: true
class $1TestHelper < CapybaraTestHelper
# Selectors: Semantic aliases for elements, a very useful abstraction.
SELECTORS = {$2}
# Getters: A convenient way to get related data or nested elements.
$3
@ElMassimo
ElMassimo / documentation_examples.md
Last active February 17, 2020 16:50
Documentation Examples

We should document fields, properties, methods, classes, and anything that would benefit from additional information besides the code itself. The sweet spot is to write enough to provide a meaningful idea of the purpose, without going overboard and writing in too much detail or things that are too obvious.

For example, if the name of a parameter already hints the type and purpose, we shouldn't need to provide additional information about it.

Which format to use?

@ElMassimo
ElMassimo / 01_obscure_spec.rb
Last active November 23, 2020 03:21
Chart Appointment Example
require 'rails_helper'
feature 'Update OCT data', js: true do
before do
create(:appointment_module_type, name: 'OCT')
appointment = create('schedule/appointment')
login_as(appointment.physician.user)
visit patient_chart_path(appointment.patient)
end
@ElMassimo
ElMassimo / 01_bookmark_create_spec.rb
Last active November 24, 2020 12:05
Ruby Yagi - Introduction to Rails testing with RSpec and Capybara - With Test Helpers
require 'rails_helper'
RSpec.describe 'create bookmark', type: :system, test_helpers: [:bookmarks] do
before { visit bookmarks_path }
scenario 'empty title and url' do
bookmarks.add(title: '', url: '')
bookmarks.should.have_error("Title can't be blank")
bookmarks.should_not.have_bookmark('Ruby Yagi')
end
@ElMassimo
ElMassimo / VideoClipsRequests.js
Last active March 13, 2021 14:29
js_from_routes: Example on how to generate request helpers for jQuery instead of fetch or axios
// JsFromRoutes CacheKey 51392094fd67182442e4e49fb7820825
//
// DO NOT MODIFY: This file was automatically generated by JsFromRoutes.
import { formatUrl } from '@helpers/UrlHelper'
export default {
downloadPath: options =>
formatUrl('/video_clips/:id/download', options),
addToPlaylist: options =>
@ElMassimo
ElMassimo / drawer_activity.java
Created January 2, 2016 21:08
Drawer Activity in Java
package com.maximomussini.anko;
import android.os.Bundle;
import android.support.design.widget.FloatingActionButton;
import android.support.design.widget.NavigationView;
import android.support.design.widget.Snackbar;
import android.support.v4.view.GravityCompat;
import android.support.v4.widget.DrawerLayout;
import android.support.v7.app.ActionBarDrawerToggle;
import android.support.v7.app.AppCompatActivity;
@ElMassimo
ElMassimo / vite.config.ts
Created February 27, 2023 22:32
How to configure resolve.alias by using paths in tsconfig.json
import { defineConfig, type AliasOptions } from 'vite'
import { readFileSync } from 'fs'
import { parse as parseJSON } from 'json5'
import { resolve } from 'path'
import { projectRoot } from 'vite-plugin-ruby'
/**
* Makes it possible to use shorter absolute path references, which are not
* ambiguous, and easier to refactor than relative paths.
*/
@ElMassimo
ElMassimo / cotizaciones_bcu.rb
Last active July 12, 2023 12:10
Banco Central del Uruguay - Billete Comprador Dólar Estadounidense - Última cotización anterior a la fecha
#!/usr/bin/env ruby
# frozen_string_literal: true
require 'savon'
# Public: Permite obtener cotizaciones utilizando los webservices del BCU.
#
# Si se ejecuta como script pasandole un argumento, imprime la ultima cotizacion
# de compra del dolar billete anterior a la fecha:
# ./cotizaciones_bcu.rb 2019-02-18