Skip to content

Instantly share code, notes, and snippets.

View bartekupartek's full-sized avatar

Bartłomiej Różański bartekupartek

View GitHub Profile
{"tilejson":"2.0.0","id":"openmaptiles","name":"OpenMapTiles","bounds":[-180,-85.0511,180,85.0511],"center":[-12.2168,28.6135,4],"format":"pbf","maxzoom":14,"minzoom":0,"version":"3.10","maskLevel":"8","planettime":"1565654400000","attribution":"<a href=\"https://www.maptiler.com/copyright/\" target=\"_blank\">&copy; MapTiler</a> <a href=\"https://www.openstreetmap.org/copyright\" target=\"_blank\">&copy; OpenStreetMap contributors</a>","description":"A tileset showcasing all layers in OpenMapTiles. https://openmaptiles.org","pixel_scale":"256","vector_layers":[{"id":"water","fields":{"class":"String","intermittent":"Number"},"maxzoom":14,"minzoom":0,"description":""},{"id":"waterway","fields":{"name":"String","class":"String","brunnel":"String","name:ar":"String","name:az":"String","name:be":"String","name:bg":"String","name:br":"String","name:bs":"String","name:ca":"String","name:co":"String","name:cs":"String","name:cy":"String","name:da":"String","name:de":"String","name:el":"String","name:en":"String","n
[
{
"id": 1,
"name": "Cleaning",
"subtitle": "We'll your home or office sparkle.",
"whiteIconUrl": "",
"blueIconUrl": "",
"imageUrl": "",
"minHours": 2,
"maxHours": 10,

Change remotes from bitbucket to github in each project directory according to <repo_name>, you can check on each step current remote by git remote -v:

  1. git remote remove origin or optinally store old origin git remote rename origin bitbucket
  2. git remote add origin git@github.com:Recruitee/<repo_name>.git

New repo names:

recruitee-widget -> jobs-widget
recruitee-extension -&gt; browser-extension
# web/helpers/session.ex
defmodule MySercetApp.Session do
alias MySercetApp.{Repo, User}
def authenticate(%{"email" => email, "password" => password}) do
user = Repo.get_by(User, email: String.downcase(email))
case check_password(user, password) do
true -> {:ok, user}
_ -> :error
@bartekupartek
bartekupartek / gist:b5900ff67adb14fe91b82ccc33ffdd4f
Created April 19, 2016 15:53 — forked from sconnelley/gist:23dd7d6e7314cbdcb0b3
Mercator Projection, from Google with Google-ly bits removed.
var Mercator = (function(){
/**
Mercator Projection
ref: https://developers.google.com/maps/documentation/javascript/examples/map-coordinates?csw=1
**/
function MercatorProjection(tileSize) {
this.tileSize = tileSize || 256;
this.ONE_DEGREE = Math.PI / 180;
@bartekupartek
bartekupartek / bcp47.ex
Created April 15, 2016 12:09 — forked from erikreedstrom/bcp47.ex
Elixir module for parsing bcp 47 (https://tools.ietf.org/html/bcp47) spec'd language tags.
defmodule BCP47 do
@moduledoc ~S"""
Main BCP47 module.
The `BCP47` module provides a parser for
[bcp 47](https://tools.ietf.org/html/bcp47) spec'd language tags.
"""
@type tag :: String.t
@bartekupartek
bartekupartek / blank.ex
Created April 15, 2016 12:09 — forked from erikreedstrom/blank.ex
Blank protocol for Elixir
defmodule Blank do
@moduledoc """
Tools around checking and handling undefined or blank data.
"""
@doc """
Returns `true` if data is considered blank/empty.
"""
def blank?(data) do
Blank.Protocol.blank?(data)
namespace :artwork_notes do
desc 'Return artwork notes'
get ':artwork_id' do
text_notes = TextNote.all('artwork_notes.es_artwork_id' => params[:artwork_id])
text_notes.map{|tn| tn.artwork_id = params[:artwork_id]}
text_notes
end
desc 'Add a note to an artwork'
params do
a = [323,434,543]
(1..5).collect { |v| {name: "pole #{v}"} }
a.tap {|ary| ary << 333}
a.include? 333
a.inject{|sum,x| sum + x }
a.reduce(:+)
headers = ["one","two","three"]