Skip to content

Instantly share code, notes, and snippets.

View futhr's full-sized avatar
:octocat:

Tobias Bohwalli futhr

:octocat:
View GitHub Profile
@futhr
futhr / mkcert.sh
Created April 9, 2020 23:10
Create a self-signed SSL certificate for localhost.
brew install mkcert
function ssl-check() {
f=~/.localhost_ssl;
ssl_crt=$f/server.crt
ssl_key=$f/server.key
b=$(tput bold)
c=$(tput sgr0)
# local_ip=$(ip route get 8.8.4.4 | head -1 | awk '{print $7}') # Linux Version
@futhr
futhr / vueforage.js
Created December 11, 2017 01:15
Vue: Forage Adapter
// -----------------------------------------------------------------------------
// Vue: Forage Adapter
//
// @example
//
// import VueForage from "services/vueforage"
//
// Vue.use(VueForage)
//
// this.$vueForage.creageInstance({
@futhr
futhr / uninstall_gems.sh
Created November 7, 2017 21:43
Convenient script to uninstall all global installed gems (..when using rbenv).
#!/usr/bin/env bash
uninstall() {
list=`gem list --no-versions`
for gem in $list; do
gem uninstall $gem -aIx
done
gem list
gem install bundler
}
@futhr
futhr / main.js
Last active May 3, 2017 12:55
myDevices Cloud API sample code.
//----------------------------------
// myDevices Cloud API sample code
//----------------------------------
// Use rather request than https
const Http = require('https');
const Util = require('util');
const API_HOST = 'va-staging-corridor.mydevices.com';
const API_PORT = 443;
@futhr
futhr / example.sh
Created August 4, 2016 14:53
Search code in all gems (for rbenv).
cd /Users/<user>/.rbenv/versions/<version>/gemsets/<project>/gems/
grep -ir <search string> *
@futhr
futhr / timestamp.bash
Created September 10, 2014 18:24
OSX create timestamp for migrations (rails g migration is so slow).
date -n +%Y%m%d%H%M%S
@futhr
futhr / capybara.rb
Last active April 21, 2016 19:14 — forked from afn/gist:c04ccfe71d648763b306
Restart and retry when Poltergeist fails randomly.
# Borrowed from https://github.com/y310/rspec-retry/blob/master/lib/rspec/retry.rb
# Drop this script into spec/support
# To test snippet just set timeout to 1
RSpec.configure do |config|
Capybara.javascript_driver = :poltergeist
Capybara.register_driver(:poltergeist) do |app|
Capybara::Poltergeist::Driver.new app,
@futhr
futhr / dabblet.css
Created September 9, 2013 19:23
Letterpress text Fx
/**
* Letterpress text Fx
* Issue: text shadow need to go on inside.
*/
@import url(http://fonts.googleapis.com/css?family=Monofett|Crushed|Voces|Quattrocento|Open+Sans|Play|Yanone+Kaffeesatz|Carrois+Gothic+SC|Zeyada|Covered+By+Your+Grace|Allura);
body {
text-align:center;
background: url(http://www.midwinter-dg.com/blog_demos/css-text-shadows/images/letterpress.gif) repeat;
@futhr
futhr / dabblet.css
Created September 9, 2013 19:23
Letterpress text Fx
/**
* Letterpress text Fx
* Issue: text shadow need to go on inside.
*/
@font-face {
font-family: 'LeagueGothicRegular';
src: url('http://www.midwinter-dg.com/blog_demos/css-text-shadows/fonts/league_gothic-webfont.eot');
src: url('http://www.midwinter-dg.com/blog_demos/css-text-shadows/fonts/league_gothic-webfont.eot?iefix') format('eot'),
url('http://www.midwinter-dg.com/blog_demos/css-text-shadows/fonts/league_gothic-webfont.woff') format('woff'),
@futhr
futhr / capybara_cheat_sheet.rb
Last active December 20, 2015 14:29 — forked from ootoovak/capybara cheat sheet.rb
Collection of Capybara >= 2.1 stuff for feature specs.
# Navigating
visit '/projects'
visit post_comments_path(@post)
# Clicking links and buttons
click_link 'id_of_link'
click_link 'Link Text'
click_button 'Save'