Skip to content

Instantly share code, notes, and snippets.

View haslinger's full-sized avatar
🏠
Working from home

Stefan Haslinger haslinger

🏠
Working from home
View GitHub Profile
@haslinger
haslinger / 0009 Login via login links sent by email.markdown
Last active August 29, 2015 14:01
Login via login links sent by email
@haslinger
haslinger / 0010_installing_ruby_and_hobo.md
Last active August 29, 2015 14:09
0010 Installing Ruby and Hobo on a fresh Ubuntu machine

Installing Ruby and Hobo on a fresh Ubuntu Machine

This way several ruby versions can be installed individually and it's easy to switch between them.

Installing prerequesties

sudo apt-get install bash curl git-core build-essential bison openssl libreadline6 libreadline6-dev zlib1g zlib1g-dev libssl-dev libsqlite3-0 libsqlite3-dev sqlite3 libxml2-dev curl git-core libyaml-dev libxslt-dev autoconf libmysqlclient-dev libreadline5 libltdl-dev libncurses5-dev libserf1-dbg libsvn1 libtool subversion libgdbm-dev pkg-config libffi-dev@
begin
require 'bundler/inline'
rescue LoadError => e
$stderr.puts 'Bundler version 1.10 or later is required. Please update your Bundler'
raise e
end
gemfile(true) do
source 'https://rubygems.org'
gem 'rails', '5.0.0.beta3'
@haslinger
haslinger / keybase.md
Created March 17, 2016 23:10
Keybase Proof

Keybase proof

I hereby claim:

  • I am haslinger on github.
  • I am informatom (https://keybase.io/informatom) on keybase.
  • I have a public key ASBlQz063oeZVZlOt9FzOcgoNP7LORbUFQtO5cd5TG4tJwo

To claim this, I am signing this object:

surround.vim
= 20160519 =
:global /{pattern}/ [cmd] führt ex-Kommando cmd für alle Zeilen, die pattern erfüllen, aus
:vglobal ... die pattern nicht erfüllen ...
qaq löscht Register a
:g/pattern/yank A in Register a anhängen
"ap inhalt Register a einfügen
:g/pattern/[range] sort sortiert Bereich range

Installation of Phoenix on Ubuntu 16.04

  • Don't use the Ubuntu packages provided, instead:
wget https://packages.erlang-solutions.com/erlang-solutions_1.0_all.deb 
sudo dpkg -i erlang-solutions_1.0_all.deb
sudo apt-get update
sudo apt-get install esl-erlang elixir
@haslinger
haslinger / have_xml.rb
Created July 26, 2016 08:13
have_xml matcher Rspec 3 compatible
module XMLMatchers
require 'libxml'
require 'rspec/expectations'
RSpec::Matchers.define :have_xml do |xpath, text|
match do |body|
parser = LibXML::XML::Parser.string body
doc = parser.parse
nodes = doc.find(xpath)
@haslinger
haslinger / deploy
Last active October 10, 2016 07:20
Deploy a Phoenix app from a Git repo onto a Ubuntu server
#!/bin/bash
echo -e "\n\e[96m === Change into directory ===\e[0m"
cd phoenix_deployment/pan/
echo -e "\n\e[96m === Start ssh agent ===\e[0m"
eval `ssh-agent -s`
echo -e "\n\e[96m === Add identity ===\e[0m"
ssh-add
@haslinger
haslinger / guide.md
Last active March 27, 2018 18:46
Remark presentations in jekyll

Just three steps to integrate Remark.js:

  • Include remark.js.min in your /js folder
  • Create a presentation layout like this
  • Write presentation like this

-> Get a presentation like this!

@haslinger
haslinger / crontab
Last active February 8, 2017 18:05
Temperature monitor
# m h dom mon dow command
# User environment wrapper provided by .rvm
*/5 * * * * /home/username/.rvm/wrappers/ruby-2.3.3/ruby /var/scripts/temperature.rb