Skip to content

Instantly share code, notes, and snippets.

View CristianRP's full-sized avatar
🎯
Focusing

Cristian Ramírez CristianRP

🎯
Focusing
  • Guatemala
View GitHub Profile
@CristianRP
CristianRP / tsconfig.md
Last active April 19, 2024 15:21
TS configuration with Webpack
@CristianRP
CristianRP / vite-testing-typescript-config.md
Last active March 31, 2024 04:05
Testing Library + Vite + Typescript + Jest

Install and Config for Jest + React Testing Library + Typescript

  1. Installations
yarn add -D jest babel-jest @babel/preset-env @babel/preset-react @babel/preset-typescript
yarn add -D @testing-library/react @types/jest jest-environment-jsdom ts-node ts-jest
  1. (Optional) If we use the Fetch API in the project.
@CristianRP
CristianRP / vite-testing-config.md
Created March 19, 2024 06:39 — forked from Klerith/vite-testing-config.md
Vite + Jest + React Testing Library - Configuraciones a seguir

Instalación y configuracion de Jest + React Testing Library

En proyectos de React + Vite

  1. Instalaciones:
yarn add --dev jest babel-jest @babel/preset-env @babel/preset-react 
yarn add --dev @testing-library/react @types/jest jest-environment-jsdom
  1. Opcional: Si usamos Fetch API en el proyecto:
@CristianRP
CristianRP / numbers.rb
Created January 30, 2024 18:15
Ruby function that prints numbers from 1 to 100, for multiples of three it prints 'APing', for multiples of five it prints 'BPong' and for multiples of both it prints 'APingBPong'
def print_numbers
(1..100).each do |number|
if (number % 3 == 0 && number % 5 == 0)
puts 'APingBPong'
elsif number % 3 == 0
puts 'APing'
elsif number % 5 == 0
puts 'BPong'
else
puts number
@CristianRP
CristianRP / index.ts
Created September 12, 2022 13:15 — forked from Klerith/index.ts
Vuex + TypeScript - Store Structure Strongly Typed
import { createStore } from 'vuex';
// My custom modules
import exampleModule from './module-template';
import { ExampleStateInterface } from './module-template/state';
export interface StateInterface {
// Define your own store structure, using submodules if needed
// example: ExampleStateInterface;
require "json"
require "selenium-webdriver"
require "rspec"
require 'webdrivers'
include RSpec::Expectations
describe "GoogleNameSearch" do
before(:each) do
@driver = Selenium::WebDriver.for :chrome
"footerCallback": function(row, data, start, end, display) {
var api = this.api();
api.columns('.sum', {
page: 'current'
}).every(function() {
var sum = this
.data()
.reduce(function(a, b) {
var x = parseFloat(a) || 0;
<env:Envelope xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:tns="http://www.caexlogistics.com/ServiceBus" xmlns:env="http://schemas.xmlsoap.org/soap/envelope/">
<env:Body>
<tns:GenerarGuia>
<tns:Autenticacion>
<tns:Login>WSAMERICANA</tns:Login>
<tns:Password>15be80dd24d69a3c43faa359ef511e08</tns:Password>
</tns:Autenticacion>
<tns:ListaRecolecciones>
<tns:DatosRecoleccion>
<tns:RecoleccionID>61</tns:RecoleccionID>
SELECT P.ID, P.NAME, COUNT(OD.ID) FORESTACION
FROM PRODUCTS P, ORDER_DETAILS OD
WHERE P.ID = OD.PRODUCT_ID
GROUP BY P.ID, P.NAME
SELECT C.NAME, COUNT(P.ID) FORESTACION FROM CATEGORIES C
INNER JOIN PRODUCTS P ON C.ID = P.CATEGORY_ID
INNER JOIN ORDER_DETAILS OD ON OD.PRODUCT_ID = P.ID
GROUP BY C.NAME
# colour output for diffs
[color]
ui = auto
[color "branch"]
current = yellow reverse
local = yellow
remote = green
[color "diff"]
meta = yellow bold
frag = magenta bold