I hereby claim:
- I am salomoko on github.
- I am salomoko (https://keybase.io/salomoko) on keybase.
- I have a public key ASBi1q5KlgJ9keGAy-kHcTDH_tO3dewW3t8MojJBl61bkwo
To claim this, I am signing this object:
| find . -name '*erb' | xargs ruby -e 'ARGV.each { |i| puts "html2haml -r #{i} #{i.sub(/erb$/,"haml")};rm #{i}"}' | bash | |
| afconvert -v -f caff -d ima4 -c 1 sourceFile.caf -o destFile.caf |
| parse_git_branch() { | |
| git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/(\1)/' | |
| } | |
| # set the PS1 variable | |
| #PS1="\w\[\e[0;33;49m\]\$(parse_git_branch)\[\e[0;0m\]$ " | |
| PS1="\w\[\e[0;37m\]\$(parse_git_branch)\[\e[0;0m\]$ " | |
| # Set git autocompletion and PS1 integration | |
| if [ -f /usr/local/Cellar/git/2.1.3/etc/bash_completion.d/git-completion.bash ]; then |
| sqlite3 ~/Library/Preferences/com.apple.LaunchServices.QuarantineEventsV* 'SELECT LSQuarantineDataURLString FROM LSQuarantineEvent' | |
| sqlite3 ~/Library/Preferences/com.apple.LaunchServices.QuarantineEventsV* 'DELETE FROM LSQuarantineEvent' | |
| # Applescript | |
| do shell script | |
| "sqlite3 ~/Library/Preferences/com.apple.LaunchServices.QuarantineEventsV* 'DELETE FROM LSQuarantineEvent'" |
| iOS WebView: | |
| Mozilla/5.0 (iPhone; CPU iPhone OS 6_1 like Mac OS X) AppleWebKit/536.26 (KHTML, like Gecko) Mobile/10B141 | |
| Mobile Safari: | |
| Mozilla/5.0 (iPad; U; CPU OS 4_3_2 like Mac OS X; en-us) AppleWebKit/533.17.9 (KHTML, like Gecko) Version/5.0.2 Mobile/8H7 Safari |
| # IMPORTANT: If you committed to the git repository before you added this .gitignore file | |
| # you need to delete the excluded files manually from your git repository, to ensure, | |
| # that they are not tracked anymore. To delete them from git, just do the following: | |
| # | |
| # git rm --cached FILENAME | |
| # | |
| .DS_Store | |
| UserInterfaceState.xcuserstate |
| import Foundation | |
| import Unbox | |
| struct Abuser { | |
| let username: String | |
| let fullName: String | |
| let age: Int | |
| let photos: [Photo]? | |
| } |
| let url = apiBaseURL + "/abusers.json" | |
| Alamofire.request(url, method: .get, parameters: params, encoding: URLEncoding.default).validate(statusCode: 200..<300).responseObject { (response: DataResponse<Abuser>) in | |
| switch response.result { | |
| case .success(let searchResult): | |
| completion?(searchResult) | |
| case .failure(let error): | |
| print("error: \(error)") | |
| } | |
| } |
I hereby claim:
To claim this, I am signing this object:
By default, Rails applications build URLs based on the primary key -- the id column from the database. Imagine we have a Person model and associated controller. We have a person record for Bob Martin that has id number 6. The URL for his show page would be:
/people/6
But, for aesthetic or SEO purposes, we want Bob's name in the URL. The last segment, the 6 here, is called the "slug". Let's look at a few ways to implement better slugs.