Skip to content

Instantly share code, notes, and snippets.

View skplunkerin's full-sized avatar
🐰
Working W02K1N6 01110111 01101111 01110010 01101011 01101001 01101110 01100111

Skplunkerin skplunkerin

🐰
Working W02K1N6 01110111 01101111 01110010 01101011 01101001 01101110 01100111
View GitHub Profile
@skplunkerin
skplunkerin / 1-Intro.md
Last active August 26, 2016 15:58
ruby on rails tutorials
@skplunkerin
skplunkerin / backitup.sh
Created August 3, 2016 16:04 — forked from wyliethomas/backitup.sh
Wylies mysql s3 backup daily backup cron solution
#!/bin/bash
NOWDATE=`date +%Y-%m-%d`
BACKUPNAME="$NOWDATE.sql.gz"
echo "Creating backup of database finances to $BACKUPNAME"
mysqldump --user=[username] --password=[password] [database] | gzip -9 > $BACKUPNAME
echo "Succesfully created database backup"
echo "Uploading backup to Amazon S3 bucket…"

How to setup your VMWare Fusion 6 images to use static IP addresses on Mac OS X

At Crush + Lovely, we use Railsmachine's Moonshine to automate the configuration of our servers. When writing our deployment recipes, VMWare Fusion's ability to take snapshots and rollback to these snapshots is a huge timesaver because it takes just seconds to roll a server image to it's original state.

When you're just configuring a single server, having a static IP address for your server image isn't too important, but when you're configuring multi-server setups, it can be useful to duplicate a number of server images and give each a static IP address so you can consistently deploy to them. While not documented well at all, it turns out that this is relatively easy to accomplish in four simple steps.

1. Determine the MAC address of your guest machine

Let's say you have a guest machine with the name ubuntu-lucid-lynx-base

@skplunkerin
skplunkerin / message.md
Last active December 6, 2023 05:02
rails custom error message validation without column

Best solution:

http://stackoverflow.com/a/808776/1180523

# model
validates   :email,    :uniqueness => { message: "is wrong" }
validates   :name,    :uniqueness => { message: "Your name is wrong" }

HUMANIZED_ATTRIBUTES = {
  :email => "E-mail address",
  :name => "" # don't include column name in error
@skplunkerin
skplunkerin / errors.md
Last active August 29, 2015 14:23
rails model error message to sentence
flash[:error] = "#{@post.errors.full_messages.to_sentence}"
@skplunkerin
skplunkerin / readme.md
Last active June 29, 2017 15:16
local tunnel ip address chromebook network node npm share local url ip address with external world doctor octopus similar deal
@skplunkerin
skplunkerin / truncate.md
Last active August 29, 2015 14:21
rails sqlite truncate single table
@skplunkerin
skplunkerin / center_me.css
Last active June 20, 2016 15:52
css center
/* http://www.smashingmagazine.com/2013/08/09/absolute-horizontal-vertical-centering-css/ */
.Absolute-Center {
height: 500px;
margin: auto;
position: absolute;
top: 0; left: 0; bottom: 0; right: 0;
}
@skplunkerin
skplunkerin / create_env_values.md
Last active August 29, 2015 14:10
rails ENV env, how do I setup rails env variables
@skplunkerin
skplunkerin / init-chromebook.md
Last active November 26, 2016 06:53
chromebook dev setup using crouton recipe