This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import org.apache.commons.csv.CSVFormat | |
import java.io.FileReader | |
import java.net.HttpURLConnection | |
import java.net.URL | |
import java.security.MessageDigest | |
fun main(args: Array<String>) { | |
val allCredentials = CSVFormat.DEFAULT.withFirstRecordAsHeader().parse(FileReader("src/main/resources/temp.csv")) | |
.filter { row -> !row["password"].isNullOrBlank() } | |
.map { row -> LastPassSite(row["name"], row["url"], hash(row["password"])) } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@ConfigurationProperties (prefix = "meaningful.prefix") | |
@Validated | |
public class MeaningfulClassNameHereProperties { | |
/** | |
* The username to access meaningfulServiceNameHerePlease. | |
*/ | |
@NotBlank | |
private String username; | |
/** |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@Configuration | |
public class FirstDatabaseConfig implements EnvironmentAware { | |
private Environment env; | |
@Override | |
public void setEnvironment(final Environment env) { | |
this.env = env; | |
} | |
@Bean |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
+ : 169 > export rvm_trace_flag=1 | |
+ : 169 > rvm_trace_flag=1 | |
+ : 174 > true 1 0 0 0 HOME=/home/rupert | |
+ : 178 > (( rvm_ignore_rvmrc == 0 )) | |
+ : 180 > for rvmrc in /etc/rvmrc '"$HOME/.rvmrc"' | |
+ : 182 > [[ -s /etc/rvmrc ]] | |
+ : 180 > for rvmrc in /etc/rvmrc '"$HOME/.rvmrc"' | |
+ : 182 > [[ -s /home/rupert/.rvmrc ]] | |
+ : 199 > [[ -z '' ]] | |
+ : 201 > (( UID == 0 )) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
system "rm -rf /tmp/app" | |
git clone: "git://gist.github.com/1296514.git /tmp/app" | |
# Rails Generators | |
application do | |
<<-EOS | |
config.generators do |g| | |
g.template_engine :haml | |
g.test_framework :rspec, fixture: true, views: false | |
g.integration_tool :rspec, fixture: true, views: true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
source 'http://rubygems.org' | |
gem 'rails', '3.1.1' | |
gem 'execjs' | |
gem 'therubyracer' | |
gem 'sqlite3' | |
gem 'haml-rails' | |
gem 'jquery-rails' # https://github.com/indirect/jquery-rails | |
gem 'simple_form' # rails generate simple_form:install |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# On server | |
sudo apt-get install synergy | |
# Enter into ~/.synergy.conf. Replace host_name and client_name with the hostnames of your computers. If some computers share hostnames, retain the default for the host | |
# and use an alias for the client later | |
# The links setup a circular pattern between two computers such that moving from the left or right of either screen makes you appear in the right place on the other screen. | |
# Customise to your preferences and number of computers. | |
section: screens | |
host_name: | |
client_name: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Add the following to ~/.bashrc | |
function parse_git_dirty() { | |
[[ $(git status 2> /dev/null | tail -n1) != "nothing to commit (working directory clean)" ]] && echo "*" | |
} | |
function ps1_git() { | |
git branch --no-color 2> /dev/null | sed -e '/^[^*]/d' -e "s/*\( .*\)/\1$(parse_git_dirty)/" | |
} | |
function ps1_rvm() { | |
[[ $(~/.rvm/bin/rvm-prompt g) != "@${PWD##*/}" ]] && echo "*" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# After you have finished, you will have the latest version of rvm, Ruby MRI, Passenger and Rails setup and ready to go | |
# Install dependencies for rvm, ruby, passenger | |
sudo apt-get install curl git-core libcurl4-openssl-dev build-essential bison openssl libreadline6 libreadline6-dev curl git-core zlib1g zlib1g-dev libssl-dev libyaml-dev libsqlite3-0 libsqlite3-dev sqlite3 libxml2-dev libxslt-dev autoconf libc6-dev ncurses-dev | |
# Optional: Install dependencies for capybara-webkit | |
sudo apt-get install libqt4-dev | |
# rvm http://beginrescueend.com/rvm/install/ | |
bash < <(curl -s https://rvm.beginrescueend.com/install/rvm) |