Skip to content

Instantly share code, notes, and snippets.

View DanielRamosAcosta's full-sized avatar
🫒
Working from Jaén

Daniel Ramos DanielRamosAcosta

🫒
Working from Jaén
View GitHub Profile
import { factorial } from "https://gist.githubusercontent.com/DanielRamosAcosta/ad514503b1c7cf8290dadb96a5fddee9/raw/4733e267f05d20110ba962c4418bab5e98abfe93/factorial.ts"
console.log(factorial(10))
<!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>
</head>
<body>
<form action="/register" method="post">
function removeDecimalNumbers([ head, ...tail ]) {
if (!head) return []
return Number.isInteger(head)
? [head, ...removeDecimalNumbers(tail)]
: removeDecimalNumbers(tail)
}
module.exports = {
removeDecimalNumbers
@DanielRamosAcosta
DanielRamosAcosta / ASCIICharKata.ex
Created August 16, 2018 21:38
ASCII Char kata in Elixir
require Integer
defmodule ASCIICharKata do
def ifPairSumAsciiChars(str) do
str
|> String.to_charlist
|> Enum.filter(&Integer.is_even/1)
|> Enum.sum
end
end
@DanielRamosAcosta
DanielRamosAcosta / num-two-times.ts
Created August 14, 2018 20:34
Number by two times
import { Observable } from 'rxjs'
import { map } from 'rxjs/operators'
export const numTwoTimes = (obs: Observable<number>) =>
obs.pipe(
map((x: number) => x * 2)
)
@DanielRamosAcosta
DanielRamosAcosta / with-marbles.ts
Created August 14, 2018 20:11
RxJS test with marble iagrams
it('multiplies each number by 2', () => {
createScheduler().run(({ cold, expectObservable }) => {
const values = { a: 1, b: 2, c: 3, x: 2, y: 4, z: 6 }
const numbers$ = cold('a-b-c-|', values) as Observable<number>
const resultDiagram = 'x-y-z-|'
expectObservable(numTwoTimes(numbers$)).toBe(resultDiagram, values)
})
})
@DanielRamosAcosta
DanielRamosAcosta / without-marbles.ts
Last active August 14, 2018 20:11
RxJS test without marbles diagrams
it('multiplies each number by 2', done => {
const numbers$ = interval(1000).pipe(
take(3),
map(n => n + 1)
)
// This emits: -1-2-3-|
const numbersTwoTimes$ = numTwoTimes(numbers$)
const results: number[] = []
@DanielRamosAcosta
DanielRamosAcosta / Alimentos.postman_collection.json
Created June 19, 2018 21:38
Alimentos.postman_collection.json
{
"info": {
"_postman_id": "41fa6e2d-cdde-79be-bf8a-0bf226b86aab",
"name": "Alimentos",
"schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json"
},
"item": [
{
"name": "Pedir alimentos por la A v2",
"request": {

Keybase proof

I hereby claim:

  • I am danielramosacosta on github.
  • I am danielramos (https://keybase.io/danielramos) on keybase.
  • I have a public key ASBxkwwa-jX46YuZq7YlAuaBViilKcVQBaEkEo6efiJLywo

To claim this, I am signing this object:

-added 670 packages in 7.947s
+added 670 packages in 8.542s
> [email protected] build /usr/local/app
> node tasks/build.js
@@ -4192,30 +4191,36 @@ Download https://download.01.org/crosswalk/releases/crosswalk/android/maven2/org
Download https://maven.google.com/com/google/firebase/firebase-iid/11.0.1/firebase-iid-11.0.1.pom
Download https://maven.google.com/com/google/android/gms/play-services-basement/11.0.1/play-services-basement-11.0.1.pom
Download https://maven.google.com/com/google/firebase/firebase-common/11.0.1/firebase-common-11.0.1.pom
-Download https://maven.google.com/com/android/support/support-v4/27.0.2/support-v4-27.0.2.pom