Skip to content

Instantly share code, notes, and snippets.

var result =
Array.prototype.slice.call(document.querySelectorAll('.semester .data')).
map(function(t) {
var td = t.querySelectorAll('td');
return[t.querySelector('[data-title="nazwaKursu"]').innerText,
parseFloat(t.querySelector('[title="ocena"]').innerText, 10),
parseFloat(td[td.length -1 ].innerText, 10)
];
}).reduce(function(r, t) {
return [r[0] + (t[1] * t[2]), r[1] + t[2]]
@arathunku
arathunku / rdp.clj
Last active October 13, 2019 06:07
Simple Ramer-Douglas-Peucker algorithm in clojure
(ns rdp.core)
; Ramer-Douglas-Peucker algorithm based on http://en.wikipedia.org/wiki/Ramer-Douglas-Peucker_algorithm
(defn- dist [point start end]
(let [num (- (* (- (first end) (first start))
(- (last start) (last point)))
(* (- (first start) (first point))
(- (last end) (last start))))
@arathunku
arathunku / The Technical Interview Cheat Sheet.md
Created September 22, 2015 22:34 — forked from tsiege/The Technical Interview Cheat Sheet.md
This is my technical interview cheat sheet. Feel free to fork it or do whatever you want with it. PLEASE let me know if there are any errors or if anything crucial is missing. I will add more links soon.

Studying for a Tech Interview Sucks, so Here's a Cheat Sheet to Help

This list is meant to be a both a quick guide and reference for further research into these topics. It's basically a summary of that comp sci course you never took or forgot about, so there's no way it can cover everything in depth. It also will be available as a gist on Github for everyone to edit and add to.

Data Structure Basics

###Array ####Definition:

  • Stores data elements based on an sequential, most commonly 0 based, index.
  • Based on tuples from set theory.
  • README needs to tell what to edit before we connect to DB
@arathunku
arathunku / git-aliases
Created August 26, 2015 19:31
git aliases
#/bin/bash
echo 'alias g=git' >> ~/.zshrc
g config --global alias.ca 'commit --amend --reuse-message=HEAD'
g config --global alias.ci commit
g config --global alias.cp cherry-pick
g config --global alias.cl clone
g config --global alias.co checkout
g config --global alias.f fetch
g config --global alias.b branch
g config --global alias.s status
@arathunku
arathunku / progress-bar.cljs
Last active August 29, 2015 14:27
Simple progress bar. #ClojureScript #React #Reframe #Reagent
(ns xxx.components.progress-bar
(:require [re-frame.core :refer [subscribe dispatch]]))
(def COLOR "rgb(178, 34, 34)")
(def VISIBLE-STYLE {:height 2 :opacity 1 :color COLOR :background-color COLOR })
(def PRGORESS-BAR-CONTAINER-STYLE {:position "fixed"
:margin 0
:padding 0
:top 0
:left 0
(let [plot (histogram (sample-normal 20))
render (-> plot .getPlot .getRenderer)]
(add-histogram plot (sample-normal 20))
; changes color of the outline
(.setSeriesOutlinePaint render 1 java.awt.Color/BLUE)
; does nothing, fill paint remains unchanged. ???????
(.setSeriesFillPaint render 1 java.awt.Color/BLUE)
(view plot))
@arathunku
arathunku / .gitignore
Created July 19, 2015 17:07
latex git ignores
words/**/*.acn
words/**/*.acr
words/**/*.alg
words/**/*.aux
words/**/*.backup
words/**/*.bbl
words/**/*.bcf
words/**/*.blg
words/**/*.brf
words/**/*.dvi
@arathunku
arathunku / clojure(script).md
Last active August 29, 2015 14:23
Clojure Beginner's friendly open source projects list
@arathunku
arathunku / shell.sh
Created May 14, 2015 06:38
clean local merged to the head branches
git branch --merged | grep -v "\*" | xargs -n 1 git branch -d