Skip to content

Instantly share code, notes, and snippets.

View adamgavlak's full-sized avatar

Adam Gavlák adamgavlak

View GitHub Profile
@adamgavlak
adamgavlak / git.sh
Created July 13, 2017 06:32
Git log alias with tree graph and colored entries
git config --global alias.lg "log --color --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit"
@adamgavlak
adamgavlak / system.css
Created June 22, 2017 10:34
System font everywhere
font-family: -apple-system, ".SFNSText-Regular", "San Francisco", "Roboto", "Segoe UI", "Helvetica Neue", "Lucida Grande", sans-serif;
function deg_to_dms(deg) {
var d = Math.floor (deg);
var minfloat = (deg-d)*60;
var m = Math.floor(minfloat);
var secfloat = (minfloat-m)*60;
var s = Math.round(secfloat);
// After rounding, the seconds might become 60. These two
// if-tests are not necessary if no rounding is done.
if (s==60) {
defmodule RateLimiter do
use GenServer
require Logger
@rate_per_minute 30
@sweep_after :timer.seconds(60)
@bucket :rate_limiter_requests
## Client
<script src="/assets/app.js"></script>
<script type="text/javascript">
require('js/app.js')
</script>
defmodule Wework.Helper do
def parameterize(string) do
string
|> String.downcase
|> String.replace(~r/[^\w-]+/, "-")
|> String.replace(~r/-{2,}/, "-")
|> String.trim("-")
end
package com.gavlak;
import java.awt.*;
/**
* Created by gavlak on 06/03/17.
*/
public class KnightsTour {
static final Point[] moves = new Point[]{
div
padding: 10px
@include for-size(desktop-up)
padding: 20px
@adamgavlak
adamgavlak / stack.c
Last active October 4, 2018 16:52
Simple dynamic stack implementation in C
//
// stack.c
//
// Created by Adam Gavlák on 26/09/16.
//
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
set nocompatible
filetype off
set rtp+=~/.vim/bundle/Vundle.vim
call vundle#begin()
" Plugins
Plugin 'VundleVim/Vundle.vim'
Plugin 'scrooloose/nerdtree'
Plugin 'ctrlpvim/ctrlp.vim'
Plugin 'elixir-lang/vim-elixir'