Skip to content

Instantly share code, notes, and snippets.

View netmask's full-sized avatar
🏠
Working from home

Jonathan Garay netmask

🏠
Working from home
View GitHub Profile
@netmask
netmask / consecutive.rb
Created May 11, 2022 20:44
non consecutive next letter
def replace(r)
starray = r.split("")
starray.each_with_index.reduce([]) do |word, current|
letter, index = current
next_letter = starray[index + 1]
word <<
if letter == '?'
get_next_letter(word.last, next_letter)

Product Management Tool (Rails/JS)

Your task is to create a simple product management tool that lets you create products and search products in a listing page. You are required to use Ruby on Rails (>=5) and React for development.

Requirements

Your app will implement 3 models.

  • Product which contains the following attributes/validations:
    • name (string (0-1024 chars), unique)
  • upc (string (10,12 or 13 chars), unique, only numeric characters (0-9) allowed)
# Product Management Tool (Rails/JS)
Your task is to create a simple product management tool that lets you create products and search products in a listing page. You are required to use Ruby on Rails (>=5) and React for development.
## Requirements
Your app will implement 3 models.
* `Product` which contains the following attributes/validations:
* `name` (string (0-1024 chars), unique)
* `upc` (string (10,12 or 13 chars), unique, only numeric characters (0-9) allowed)
require "minitest/autorun"
module ArrayTools
refine Array do
def flatt
reduce([]) do |new_array, el|
if el.instance_of? Array
new_array += el.flatt
else
import java.util.*;
public class Matriculas {
public static void main(String[] args) {
Scanner scanner = new Scanner(System.in);
HashMap<String, List<Double>> matriculas = new HashMap<String, List<Double>>();
#include <stdio.h>
#include <ctype.h>
#include <memory.h>
int main() {
char marca[10];
printf("tt Mejor Carro De Marcas Mostradas En Ejemplo \n");
printf("ttnn Ingresa Cualquier Marca De Carro Que Aparece Abajo \n");
do{
study();
work():
beDad();
beAwesome();
grade + = grade +1
}while(grade == Carrier:SOFTWARE_ENGENEER
){
success(new Dregree());
Verifying I am +netmask on my passcard. https://onename.com/netmask
@netmask
netmask / NSDate range operator
Created March 11, 2015 22:19
Simple Swift NSDate Iterator
infix operator .. {}
extension NSDate {
var components: NSDateComponents{
var calendar = NSCalendar(calendarIdentifier: NSGregorianCalendar)
var flags: NSCalendarUnit = .DayCalendarUnit | .WeekdayCalendarUnit | .YearCalendarUnit | .MonthCalendarUnit | .HourCalendarUnit
return calendar!.components(flags, fromDate: self)
}
}
def anagrams()
anagrams = {}
words = []
['CASA', 'SACA', 'AMACA'].each do |word|
anagrams[word] = word.chars.sort
end
anagrams.each do |word, anagram|