Skip to content

Instantly share code, notes, and snippets.

View mfandl's full-sized avatar

Matej Fandl mfandl

View GitHub Profile
⍝ My attempt to implement a hopfield network with synchronous update rule in APL
⍝ Our network is a weight matrix created from array of patterns (vectors)
net ← {ws ← ⊃+⌿∘.×⍨¨⍵ ⋄ (1 1⍉ws) ← 0 ⋄ ws}
⍝ LHS argument is the net, RHS is the probe we want to update
update ← {(2×0∘<⍵+.×⍺)-1}
⍝ Example use
set number
set expandtab
set tabstop=2
set softtabstop=2
set shiftwidth=2
set nofoldenable
let g:mapleader = ','
filetype plugin on
[
{
"creationDate": "2018-10-24 12:24:51 +0100",
"value": "81"
},
{
"creationDate": "2018-10-24 12:24:55 +0100",
"value": "78"
},
{
const propertyExtractor = propName => ({ [propName]: prop }) => prop
const idExtractor = propertyExtractor('id')
const nameExtractor = propertyExtractor('name')
const convict = { id: 7556, name: 'ash' }
console.log(idExtractor(convict), nameExtractor(convict)) // 7556 "ash"
const finishedLevelsCount = levels
.filter(({ finished }) => finished)
.reduce(acc => acc + 1, 0);
@mfandl
mfandl / lesson1.clj
Last active August 1, 2018 21:23
clojure school lesson 1 recap and exercises
;; WIP material
;; RECAP
; clojure expressions are lists
; syntactically, lists are values in parentheses delimited by white space
(1 2 3)
; clojure expects each expression is built in such a way,
; that the first element is a function name followed by its arguments
const obj = {a : 2}
const fn = propName => ({ [propName]: prop }) => prop == 2
console.log(fn('a')(obj))
// Output down
const arr = [
{ value: 1 },
{ value: 2 },
{ value: 3 },
undefined,
{ value: 5 },
{ value: 6 }
];
// this productivity app blurs parts of aby webpage that are currently not important for you to read
// to use it, open devtools with f12, copy the following line to the console and hit enter.
Array.prototype.forEach.call(document.getElementsByTagName('*'), e => e.style.filter = `blur(${Math.random() < 0.95 ? 0 : 4}px)`)
@mfandl
mfandl / init.vim
Last active March 19, 2018 14:31
my neovim config
set number
set expandtab
set tabstop=2
set softtabstop=2
set shiftwidth=2
set nofoldenable
let g:mapleader = ','
let g:ale_fixers = {
\ 'javascript': ['eslint']