Skip to content

Instantly share code, notes, and snippets.

View bossiernesto's full-sized avatar

Ernesto Gabriel Bossi Carranza bossiernesto

View GitHub Profile
const randomDelay = () => new Promise(resolve =>
setTimeout(resolve, Math.random() * 100)
)
// Variable
let balance = 0
async function loadBalance () {
// delay in getting the load balance
await randomDelay()
const arr = x => Array.from(x);
const num = x => Number(x) || 0;
const str = x => String(x);
const isEmpty = xs => xs.length === 0;
const take = n => xs => xs.slice(0,n);
const drop = n => xs => xs.slice(n);
const reverse = xs => xs.slice(0).reverse();
const comp = f => g => x => f (g (x));
const chunk = n => xs =>
isEmpty(xs) ? [] : [take(n)(xs), ...chunk (n) (drop (n) (xs))];
require 'action_view'
module ActionView::Helpers::NumberHelper
def self.number_to_words(number)
numbers_to_name = {
1000000 => "million",
1000 => "thousand",
100 => "hundred",
90 => "ninety",
80 => "eighty",
module Memoization
def memoize(name)
@@lookup ||= Hash.new { |h, k| h[k] = {} }
fx = instance_method(name)
define_method(name) do |args|
return @@lookup[name][args] if @@lookup[name].include?(args)
@@lookup[name][args] = fx.bind(self).call(args)
end
package a;
import java.util.Scanner;
public class Main {
public final static double pi = 3.14;
public static void main(String[] args) {
int diametro;
import java.util.Scanner;
public class Main {
//package Main;
public static void
main(String[] args) {
double area, perimetro;
Scanner entrada = new Scanner
(System.in);
import sys
import time
import itertools
def spinning_cursor():
while True:
for cursor in '|/-\\':
yield cursor
#spinner = spinning_cursor()

Esto es un gist de prueba