Skip to content

Instantly share code, notes, and snippets.

View ltackett's full-sized avatar

Lorin Tackett ltackett

View GitHub Profile
-- rename_column(:ratings, :user_id, :creator_id)
-> 0.3180s
-- rename_column(:recommendations, :user_id, :creator_id)
-> 0.1072s
== RenameUserAssociationToCreator: migrated (2.6912s) ========================
== CreateLinkTables: migrating ===============================================
The name 'UserCalendarEventLink' is either already used in your application or reserved by Ruby on Rails.
Please choose an alternative and run this generator again.
-- create_table(:user_calendar_event_links)
@ltackett
ltackett / application.haml
Created April 14, 2010 22:06
3d-looking thing I did in StaticMatic one day for Lunch... http://img.skitch.com/20100414-xusunswcpispbk94mheg6kfnr9.png
!!!
%html
%head
%title StaticMatic
-# Call stylesheets
= stylesheets
-# Call AJAX libraries
= javascripts 'http://www.google.com/jsapi', :modernizr
// Support for mozilla in experimental css3 properties.
$experimental-support-for-mozilla : true !default;
// Support for webkit in experimental css3 properties.
$experimental-support-for-webkit : true !default;
// Support for opera in experimental css3 properties.
$experimental-support-for-opera : false !default;
// Support for microsoft in experimental css3 properties.
$experimental-support-for-microsoft : false !default;
// Support for khtml in experimental css3 properties.
$experimental-support-for-khtml : false !default;
# sounds -- YES! SOUNDS!
export SUCCEED="$HOME/Music/succeed.mp3"
export FAIL="$HOME/Music/fail.mp3"
alias g='git'
# Gush was just an alias before, but this is way better.
# Thanks M. Dave Auayan ( http://github.com/sxtxixtxcxh )
function gush {
g push "$@"
def body_class
class_names.join(" ")
end
def body_class_current_page
current_page.gsub("/", "").gsub(".html", "")
end
def class_names
body_class = [body_class_current_page]
// class and rel for grabbing a file and printing it inline via AJAX
var ajaxme = function(container, source){
$.ajax({
url: source,
success: function(data){
container.text(data);
},
error: function(){
container.html('File Not Found.')
}
<label for="first_name">First Name</label>
<div class="input text">
<input type="text" id="first_name" />
</div>
<label for="last_name">Last Name</label>
<div class="input text">
<input type="text" id="last_name" />
</div>
ssh_user = "[email protected]" # for rsync deployment
remote_root = "~/domain.com/path.to/project" # for rsync deployment
def fs_deploy(relative)
puts ">>> Change Detected to: #{relative} >> Deploying"
system("rake deploy")
end
desc "Watch the site and regenerate when it changes"
task :watch do
// This keeps things organized with the indentation you want
#dashboard-content {
/*rule:value;*/
&.my-account-v2 {
/*rule:value;*/
.page { /*rule:value;*/ }
.inner { /*rule:value;*/ }
.inbox-sidebar { /*rule:value;*/ } } }
.inbox-sidebar {
@ltackett
ltackett / gist:894734
Created March 30, 2011 16:28
inset-border.sass
@import compass/css3/box-shadow
=inset-border($direction, $border-color: #333, $highlight-color: #fff, $highlight-opacity: 0.9, $border-width: 1px, $border-style: solid)
@if $direction == "left"
+box-shadow(rgba($highlight-color, $highlight-opacity), -1px, 0, 0, 0)
@if $direction == "right"
+box-shadow(rgba($highlight-color, $highlight-opacity), 1px, 0, 0, 0)
@if $direction == "top"
+box-shadow(rgba($highlight-color, $highlight-opacity), 0, 1px, 0, 0, inset)
@if $direction == "bottom"
+box-shadow(rgba($highlight-color, $highlight-opacity), 0, 1px, 0, 0)