Skip to content

Instantly share code, notes, and snippets.

View jairoFernandez's full-sized avatar
🙃
creating....

Jairo Fernández jairoFernandez

🙃
creating....
View GitHub Profile
@jairoFernandez
jairoFernandez / creator_functions.dart
Last active December 15, 2020 17:41
Creator Functions
createProducts(int quantity) {
final data = [];
for (var i = 0; i < quantity; i++) {
data.add({"id": i, "name": "name $i", "user": rng.nextInt(quantity - 1)});
}
return data;
}
createUsers(int quantity) {
final data = [];
const any from 'any-library';
@jairoFernandez
jairoFernandez / version.dart
Created August 11, 2020 17:28
Read pubspec.yaml
import 'dart:io';
import 'package:path/path.dart';
import 'package:yaml/yaml.dart';
Map<String, String> getVersion() {
final pathToYaml =
join(dirname(Platform.script.toFilePath()), '../../pubspec.yaml');
final f = File(pathToYaml);
final yamlText = f.readAsStringSync();
#!/usr/bin/env bash
echo "Assistance of installations for devs"
PS3='Please enter your choice: '
options=("Option 1" "Option 2" "Option 3" "Quit")
select opt in "${options[@]}"
do
case $opt in
"Option 1")
echo "you chose choice 1"
require 'rdl'
extend RDL::Annotate
x = [1,2,3,6]
class Maybe
attr_accessor :data
end
class Just < Maybe
@jairoFernandez
jairoFernandez / REINCIAR_EXPLORADOR.bat
Created August 17, 2018 15:15
Reinicia el explorador...
@ECHO OFF
@ECHO.
echo ===============================================
echo SINCOSOFT
echo ============ Reiniciado explorador ============
@ECHO.
taskkill.exe /F /IM explorer.exe
@ECHO.
CALL :ReiniciarExplorador && (
@jairoFernandez
jairoFernandez / TodoApp-Redux.js
Created August 4, 2018 21:32
Implementación de un TodoApp con redux, sin reactjs
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>Todo app</title>
<script src="https://cdnjs.cloudflare.com/ajax/libs/redux/4.0.0/redux.min.js"></script>
</head>
@jairoFernandez
jairoFernandez / Redux-fundamentals.html
Created August 4, 2018 18:21
Implementación básica de redux, sin react
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>Document</title>
<script src="https://cdnjs.cloudflare.com/ajax/libs/redux/4.0.0/redux.min.js"></script>
</head>
<body>
@jairoFernandez
jairoFernandez / Reactjs-getstarted.html
Last active August 4, 2018 17:06
Get started with reactjs without node
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>Document</title>
<script crossorigin src="https://unpkg.com/react@16/umd/react.development.js"></script>
<script crossorigin src="https://unpkg.com/react-dom@16/umd/react-dom.development.js"></script>
@jairoFernandez
jairoFernandez / console.js
Created June 4, 2018 01:30
Imprimir consola
(function () {
if (!console) {
console = {};
}
var old = console.log;
var logger = document.getElementById('log');
console.log = function (message) {
if (typeof message == 'object') {
logger.innerHTML += (JSON && JSON.stringify ? JSON.stringify(message) : String(message)) + '<br />';
} else {