Skip to content

Instantly share code, notes, and snippets.

@rlopc
rlopc / gist:bc14f65336ce0530194073a45eeef641
Created November 20, 2016 21:16
R installation - system locale set by default to an UTF-8
defaults write org.R-project.R force.LANG en_US.UTF-8
@rlopc
rlopc / ruby_install.sh
Created August 3, 2016 14:51
ruby installation
brew install rbenv ruby-build
# Add rbenv to bash so that it loads every time you open a terminal
echo 'if which rbenv > /dev/null; then eval "$(rbenv init -)"; fi' >> ~/.bash_profile
source ~/.bash_profile
# Install Ruby
rbenv install 2.3.1
rbenv global 2.3.1
ruby -v
@rlopc
rlopc / cleanContextualMenu.sh
Last active August 1, 2016 01:16
clean duplicated items in contextual menu
# Contextual Menu
/System/Library/Frameworks/CoreServices.framework/Frameworks/LaunchServices.framework/Support/lsregister -kill -r -domain local -domain system -domain user
killall Finder
@rlopc
rlopc / timestamp2date.R
Last active August 1, 2016 01:21
timestamp to date
# transform timestamp to date
as.POSIXct(timestamp, origin="1970-01-01", tz = "Europe/London")
@rlopc
rlopc / usbInstallerMacOS.sh
Last active August 1, 2016 01:22
Bootable USB Drive for OS X Installer
sudo /Applications/Install\ OS\ X\ <MacOS_version>.app/Contents/Resources/createinstallmedia --volume /Volumes/<path_destination> --applicationpath /Applications/Install\ OS\ X\ <MacOS_version>.app --nointeraction
@rlopc
rlopc / sed_replace.sh
Last active February 22, 2016 13:32
reemplazar el patrón "\\n" en varios ficheros con el comando 'sed' y guardar copia de los originales con extensión ".orig"
find ./*.csv -type f -exec sed -i .orig -e ':a' -e 'N' -e '$!ba' -e 's/\\\n//g' {} \;
@rlopc
rlopc / osxAppInstallWithHomebrew.sh
Last active August 1, 2016 01:32 — forked from t-io/osx_install.sh
Install most of my Apps with homebrew & cask
#!/usr/bin/env bash
# install homebrew
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
# install brew taps
brew tap caskroom/cask
#brew tap caskroom/versions
brew tap homebrew/science
#!/bin/sh
# Alot of these configs have been taken from the various places
# on the web, most from here
# https://github.com/mathiasbynens/dotfiles/blob/master/.osx
# Set the colours you can use
black='\033[0;30m'
white='\033[0;37m'
red='\033[0;31m'
# ---------------------------------------------------------------------------
#
# Description: This file holds all my BASH configurations and aliases
#
# Sections:
# 1. Environment Configuration
# 2. Make Terminal Better (remapping defaults and adding functionality)
# 3. File and Folder Management
# 4. Searching
# 5. Process Management
#!/bin/sh
# Alot of these configs have been taken from the various places
# on the web, most from here
# https://github.com/mathiasbynens/dotfiles/blob/master/.osx
# Set the colours you can use
black='\033[0;30m'
white='\033[0;37m'
red='\033[0;31m'