Skip to content

Instantly share code, notes, and snippets.

View vince's full-sized avatar

Vince Wadhwani vince

View GitHub Profile
@Aldarone
Aldarone / winestar.sh
Last active August 29, 2015 14:00
Wildstar launcher for Wine
#!/bin/bash
# Tested with wine-1.7.17
# Put this script and the Wildstar.exe installer in a directory
# Edit the VIDEO_MEMORY_SIZE according to your graphic card.
#
# At first launch, use `./winestar.sh install` and keep the default install directory
#
# Once the launcher is downloaded you can simply use ./winestar.sh
@jcasimir
jcasimir / sessions_and_conversations.markdown
Created September 11, 2011 23:07
Sessions and Conversations in Rails 3

Sessions and Conversations

HTTP is a stateless protocol. Sessions allow us to chain multiple requests together into a conversation between client and server.

Sessions should be an option of last resort. If there's no where else that the data can possibly go to achieve the desired functionality, only then should it be stored in the session. Sessions can be vulnerable to security threats from third parties, malicious users, and can cause scaling problems.

That doesn't mean we can't use sessions, but we should only use them where necessary.

Adding, Accessing, and Removing Data

@jcasimir
jcasimir / friendly_urls.markdown
Created September 11, 2011 15:48
Friendly URLs in Rails

Friendly URLs

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.