Skip to content

Instantly share code, notes, and snippets.

View berga's full-sized avatar

Marco Bergantin berga

  • TIM - Gruppo Telecom Italia
  • Cagliari, Italy
View GitHub Profile
@berga
berga / Vagrantfile
Created February 8, 2018 15:18 — forked from creisor/Vagrantfile
Vagrant file for installing ruby with rbenv
# -*- mode: ruby -*-
# vi: set ft=ruby :
RUBY_V = File.open("./.ruby-version") { |f| f.read }.chomp
$apt_script = <<SCRIPT
sudo apt-get update
sudo apt-get install -y git-core curl zlib1g-dev build-essential libssl-dev libreadline-dev libyaml-dev libsqlite3-dev sqlite3 libxml2-dev libxslt1-dev libcurl4-openssl-dev python-software-properties libffi-dev libmysqlclient-dev
SCRIPT
@berga
berga / uiwebview_snippet.js
Created February 1, 2018 12:54 — forked from chrisallick/uiwebview_snippet.js
JavaScript only solution for detecting UIWebView.
// http://stackoverflow.com/questions/4460205/detect-ipad-iphone-webview-via-javascript
var standalone = window.navigator.standalone,
userAgent = window.navigator.userAgent.toLowerCase(),
safari = /safari/.test( userAgent ),
ios = /iphone|ipod|ipad/.test( userAgent );
if( ios ) {
if ( !standalone && safari ) {
//browser
} else if ( standalone && !safari ) {
@berga
berga / rbenv-install-system-wide.sh
Last active April 24, 2019 01:42 — forked from jnx/rbenv-install-system-wide.sh
rbenv install and system wide install on Ubuntu 16.04 LTS.
# Update, upgrade and install development tools:
apt update
apt -y upgrade
apt -y install build-essential git-core
# Install rbenv
git clone git://github.com/sstephenson/rbenv.git /usr/local/rbenv
# Add rbenv to the path:
echo '# rbenv setup' > /etc/profile.d/rbenv.sh
@berga
berga / keybase.md
Created May 22, 2017 10:01
Keybase proof

Keybase proof

I hereby claim:

  • I am berga on github.
  • I am berga (https://keybase.io/berga) on keybase.
  • I have a public key ASAssUJ8HJJrWYtbp9GhTzYLqB5UwAmEshZB6JJrT7pvEQo

To claim this, I am signing this object:

@berga
berga / migrate_postgresql_database.md
Created February 24, 2017 12:39 — forked from olivierlacan/migrate_postgresql_database.md
How to migrate a Homebrew-installed PostgreSQL database to a new major version (9.3 to 9.4) on OS X

This guide assumes that you recently run brew upgrade postgresql and discovered to your dismay that you accidentally bumped from one major version to another: say 9.3.x to 9.4.x. Yes, that is a major version bump in PG land.

First let's check something.

brew info postgresql

The top of what gets printed as a result is the most important:

@berga
berga / Remove all git tags
Created October 20, 2016 12:06 — forked from okunishinishi/Remove all git tags
Delete all git remote tags
#Delete local tags.
git tag -l | xargs git tag -d
#Fetch remote tags.
git fetch
#Delete remote tags.
git tag -l | xargs -n 1 git push --delete origin
#Delete local tasg.
git tag -l | xargs git tag -d