Skip to content

Instantly share code, notes, and snippets.

View lukasborawski's full-sized avatar

Lukas Borawski lukasborawski

View GitHub Profile
@lukasborawski
lukasborawski / index.js
Last active October 2, 2017 14:45
Scroll to Element for Angular 2
scrollToBottom () {
function offset(el:any) {
let rect = el.getBoundingClientRect(),
scrollLeft = window.pageXOffset || document.documentElement.scrollLeft,
scrollTop = window.pageYOffset || document.documentElement.scrollTop;
return { top: rect.top + scrollTop, left: rect.left + scrollLeft }
}
let content = document.getElementById('content')
if (content) {
let offsetTop = offset(content).top
@lukasborawski
lukasborawski / setup.md
Created October 2, 2017 14:44 — forked from developius/README.md
Set up GitHub push with SSH keys

Create a repo. Make sure there is at least one file in it (even just the README) Generate ssh key:

ssh-keygen -t rsa -C "your_email@example.com"

Copy the contents of the file ~/.ssh/id_rsa.pub to your SSH keys in your GitHub account settings. Test SSH key:

ssh -T git@github.com
@lukasborawski
lukasborawski / api.js
Last active January 25, 2018 14:40
Axios API Call Shorthand
import axios from 'axios'
export default {
get (path) {
if (path.indexOf('/') !== 0) {
path = '/' + path
}
return axios
.get('//' + process.env.apiHost + ':' + process.env.apiPort + '/api' + path)
.then(({data}) => data)