Skip to content

Instantly share code, notes, and snippets.

View guayom's full-sized avatar

Guayo Mena guayom

  • Kemcom Costa Rica
  • Costa Rica
View GitHub Profile
@guayom
guayom / in-operator.ts
Last active June 6, 2020 17:58
Typescript patterns
// Use the Javascript "in" operator for automatic type inference
// https://egghead.io/lessons/typescript-use-the-javascript-in-operator-for-automatic-type-inference-in-typescript
interface Admin {
id: string;
role: string;
}
interface User {
email: string;
@guayom
guayom / index.html
Last active April 5, 2020 23:56
Test ways to group arrays
‎‎​
@guayom
guayom / import.rb
Created September 5, 2017 21:39
Hugo import from yml database with ruby
require 'yaml'
require 'parameterize'
require 'open-uri'
require 'fileutils'
idustries = YAML.load_file('import/v5n_novatec_idustries.yml')
idustries.each_with_index do |idustry, index|
unless idustry['state'] == -2
FileUtils::mkdir_p "content/idustries/#{idustry['titulo'].parameterize}"