Skip to content

Instantly share code, notes, and snippets.

View alucic's full-sized avatar

Ante Lucic alucic

  • NYC
View GitHub Profile
@alucic
alucic / client.go
Created March 31, 2019 03:06 — forked from amlwwalker/client.go
Golang Multipart upload to S3 over HTTP using tusd
package main
import (
"bytes"
"errors"
"fmt"
"io"
"log"
"mime/multipart"
"net/http"
@alucic
alucic / palindrome.js
Created August 27, 2015 21:01
Get the longest palindrome for a given string
// example: node palindrome.js bananas
var input = process.argv[2];
if (!input || !input.length) {
return '';
}
var longest = longestPalindrome(input);
@alucic
alucic / jscs.json
Created August 12, 2015 19:07
jscs
{
"disallowSpacesInNamedFunctionExpression": {
"beforeOpeningRoundBrace": true
},
"disallowSpacesInFunctionDeclaration": {
"beforeOpeningRoundBrace": true
},
"disallowEmptyBlocks": true,
"disallowSpacesInsideArrayBrackets": true,
"disallowSpacesInsideParentheses": true,
# Git aliases
alias gs="git status "
alias gg="git grep "
alias gl="git log"
alias ga="git add "
alias gaa="git add --all"
alias gc="git commit -m "
alias gco="git checkout "
alias gcm="git checkout master"
alias gpo="git pc"
@alucic
alucic / gist:6215125
Last active December 20, 2015 23:48 — forked from paulirish/gist:4158604
Learn JavaScript concepts with the Chrome DevTools

Authored by Peter Rybin , Chrome DevTools team

In this short guide we'll review some new Chrome DevTools features for "function scope" and "internal properties" by exploring some base JavaScript language concepts.

Closures

Let's start with closures – one of the most famous things in JS. A closure is a function, that uses variables from outside. See an example:

function A(a, b, c) {