This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.gavlak; | |
import java.awt.*; | |
/** | |
* Created by gavlak on 06/03/17. | |
*/ | |
public class KnightsTour { | |
static final Point[] moves = new Point[]{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
defmodule Wework.Helper do | |
def parameterize(string) do | |
string | |
|> String.downcase | |
|> String.replace(~r/[^\w-]+/, "-") | |
|> String.replace(~r/-{2,}/, "-") | |
|> String.trim("-") | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<script src="/assets/app.js"></script> | |
<script type="text/javascript"> | |
require('js/app.js') | |
</script> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
defmodule RateLimiter do | |
use GenServer | |
require Logger | |
@rate_per_minute 30 | |
@sweep_after :timer.seconds(60) | |
@bucket :rate_limiter_requests | |
## Client |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
font-family: -apple-system, ".SFNSText-Regular", "San Francisco", "Roboto", "Segoe UI", "Helvetica Neue", "Lucida Grande", sans-serif; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(function() { | |
var CalendarDate, RelativeTime, browserIsCompatible, domLoaded, iso8601, months, pad, parse, parseTimeZone, process, relativeDate, relativeTimeAgo, relativeTimeOrDate, relativeWeekday, run, strftime, update, weekdays; | |
browserIsCompatible = function() { | |
return document.querySelectorAll && document.addEventListener; | |
}; | |
if (!browserIsCompatible()) { | |
return; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
set tabstop=8 softtabstop=0 expandtab shiftwidth=4 smarttab | |
colorscheme badwolf | |
syntax enable | |
set number | |
set showcmd | |
set cursorline | |
filetype indent on | |
set wildmenu |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
RewriteEngine on | |
# Force ssl | |
RewriteCond %{SERVER_PORT} ^80$ | |
RewriteRule ^(.*)$ https://www.%{SERVER_NAME}%{REQUEST_URI} [L,R=301,NC] |