Skip to content

Instantly share code, notes, and snippets.

👮‍♀
git inspector

Andrew Luca iamandrewluca

👮‍♀
git inspector
Block or report user

Report or block iamandrewluca

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View 00-ReduxFormDocsDeploy.md

Directory structure

View keybase.md

Keybase proof

I hereby claim:

  • I am iamandrewluca on github.
  • I am iamandrewluca (https://keybase.io/iamandrewluca) on keybase.
  • I have a public key ASA4sAeraWT9MWtXOJit0Eipbcf78FV9KunwN9OSd_cWOgo

To claim this, I am signing this object:

View csv-parse.js
const parse = require('csv-parse/lib/sync')
const fs = require('fs')
module.exports = parse(fs.readFileSync('./src/routes.csv'), {
columns: true,
skip_empty_lines: true,
})
@iamandrewluca
iamandrewluca / index.lisp
Last active Oct 1, 2019
Decompose number in digits
View index.lisp
(DEFUN COMP (N &OPTIONAL REZ)
(COND
((< N 10) (CONS N REZ))
(T (COMP
(/ (- N (rem N 10)) 10)
(CONS (rem N 10) REZ)
))
)
)
@iamandrewluca
iamandrewluca / index.lisp
Last active Oct 1, 2019
LISP Lambda call
View index.lisp
(defun test (L) (lambda (M) L))
(setq L `(1 2 3))
(setq test1 (test L))
(write (funcall test1 10)) ; (1 2 3)
@iamandrewluca
iamandrewluca / lab1.lisp
Last active Oct 1, 2019
Functional Programming (V4)
View lab1.lisp
;;;; Din o lista L de atomi afisati toate numerele mai mari ca 11
(DEFUN biggerThan11 (L &OPTIONAL REZ)
(COND
((NULL L) REZ)
((AND (NUMBERP (CAR L)) (> (CAR L) 11))
(biggerThan11
(CDR L)
(CONS (CAR L) REZ)
)
@iamandrewluca
iamandrewluca / lab1.lisp
Last active Oct 10, 2019
Functional Programming (V24)
View lab1.lisp
;;;; Aplicand recursia si variabile colectoare din lista de atomi arbitrari L
;;;; sa se elimine toti atomii numerici
(DEFUN remove-numbers (L &OPTIONAL REZ)
(COND
((NULL L) REZ)
((NUMBERP (CAR L))
(remove-numbers (CDR L) REZ)
)
View index.lisp
(DEFUN numar(L)
(COND
((NULL L) NIL)
((NUMBERP (CAR L))
(PRINT (CAR L))
(numar (CDR L))
)
(T (numar (CDR L)))
@iamandrewluca
iamandrewluca / move-elements-to-start.spec.ts
Last active Sep 24, 2019
Move array elements to start of array
View move-elements-to-start.spec.ts
import { moveElementsToStart } from '../move-elements-to-start'
describe('moveElementsToStart', () => {
it('should move simple elements to start', () => {
expect(moveElementsToStart([
'CH', 'IT', 'RU', 'MD', 'AU', 'US', 'RO'
], [])).toEqual([
'CH', 'IT', 'RU', 'MD', 'AU', 'US', 'RO'
])
@iamandrewluca
iamandrewluca / exact-type.ts
Created Sep 20, 2019
Make TypeScript match types exactly
View exact-type.ts
type Exact<T, Shape> =
// Check if `T` is matching `Shape`
T extends Shape
// Does match
// Check if `T` has same keys as `Shape`
? Exclude<keyof T, keyof Shape> extends never
// `T` has same keys as `Shape`
? T
// `T` has more keys than `Shape`
: never
You can’t perform that action at this time.