Skip to content

Instantly share code, notes, and snippets.

View lukalopusina's full-sized avatar

Luka Lopusina lukalopusina

View GitHub Profile
@lukalopusina
lukalopusina / js
Last active January 29, 2017 23:49
Convex layers algorithm
function cross(o, a, b) { return (a.x - o.x) * (b.y - o.y) - (a.y - o.y) * (b.x - o.x); }
function sortPoint(points) {
points.sort(function(a, b) {
return a.x == b.x ? a.y - b.y : a.x - b.x;
});
}
function convexHull(points, animation, animationConvex) {
var lower = [], upper = [];
@lukalopusina
lukalopusina / git-aliases
Last active June 9, 2021 15:49
GIT Aliases
# GIT
# --------------------------------------------
alias ga="git add"
alias gaa="git add ."
alias gc="git commit -m "
alias gp="git push github"
alias gs="git status"
alias nah="git reset --hard; git clean -df;"
# --------------------------------------------
@lukalopusina
lukalopusina / ajax.js
Last active April 29, 2016 17:19
jQuery ajax
$.ajax({
type: "GET",
url: "",
dataType: "json",
success: function(data){
console.log(data);
}
});