Skip to content

Instantly share code, notes, and snippets.

View smockle's full-sized avatar

Clay Miller smockle

View GitHub Profile
@smockle
smockle / Links.md
Last active April 6, 2020 02:56
Links collects useful links for web developers and web designers.
@smockle
smockle / Request.cs
Last active December 17, 2015 11:29
Request lists C# Request object properties with examples.
Request.ApplicationPath = "/virtual_dir";
Request.CurrentExecutionFilePath = "/virtual_dir/webapp/page.aspx";
Request.FilePath = "/virtual_dir/webapp/page.aspx";
Request.Path = "/virtual_dir/webapp/page.aspx";
Request.PhysicalApplicationPath = "d:\Inetpub\wwwroot\virtual_dir\";
Request.QueryString = "/virtual_dir/webapp/page.aspx?q=qvalue";
Request.Url.AbsolutePath = "/virtual_dir/webapp/page.aspx";
Request.Url.AbsoluteUri = "http://localhost:2000/virtual_dir/webapp/page.aspx?q=qvalue";
Request.Url.Host = "localhost";
Request.Url.Authority = "localhost:80";
@smockle
smockle / Location.js
Last active December 17, 2015 11:29
Location lists JavaScript window.location properties with examples.
// http://smockle.com:80/home/index?s=build+the+internet#lorem
window.location = {
hash: "#lorem",
host: "smockle.com",
hostname: "smockle.com",
href: "http://smockle.com:80/home/index?s=build+the+internet#lorem",
pathname: "/home/index",
port: "80",
protocol: "http:",
search: "?s=build+the+internet",
@smockle
smockle / Fields.rb
Last active December 17, 2015 11:29
Fields lists Rails database column types.
# DATABASE TYPES
# eg. field_name:field_type
:string, :text, :integer, :float, :decimal, :datetime, :timestamp, :time, :date, :binary, :boolean, :references
@smockle
smockle / Unicode.txt
Last active December 17, 2015 11:29
Unicode lists common unicode character codes.
\u00E1 á
\u00C1 Á
\u00E9 é
\u00C9 É
\u00ED í
\u00CD Í
\u00F3 ó
\u00D3 Ó
\u00FA ú
\u00DA Ú
@smockle
smockle / Git.sh
Created May 17, 2013 21:46
Git configures a new git repository.
cd <Project>
git init .
git add .
git commit -am 'Initial commit.'
github
git remote add origin https://github.com/smockle/<Project>.git
git push origin master
@smockle
smockle / Caboose.sh
Last active December 17, 2015 11:29
Caboose collects common Rails and Heroku commands.
# NEW PROJECT
rails new <Project>
cd <Project>
rake db:create
rails g controller home index
rm public/index.html
sed -i '' "s/# root :to => 'welcome#index'/root :to => 'home#index'/g" config/routes.rb
# HEROKU CREATE
heroku create --remote staging
@smockle
smockle / Ruby-2.sh
Last active December 17, 2015 11:29
Ruby-2 lists the commands used to upgrade from Ruby 1.9.x to Ruby 2.0.0 on OS X 10.8 Mountain Lion.
brew doctor
brew update
brew doctor
rvm requirements
rvm get head
rvm requirements
# rvm install ruby-head
rvm install 2.0.0
rvm use 2.0.0
rvm default 2.0.0
@smockle
smockle / Errors.md
Last active December 17, 2015 11:29
Errors explains how to enable custom errors in Rails.
  1. Register your application by appending this to config/application.rb:

    config.exceptions_app = self.routes
    
  2. Add routes by appending this to config/routes.rb:

match '/404', :to => 'errors#not_found'

@smockle
smockle / RailsCasts.terminal
Created May 22, 2013 02:48
RailsCasts is a OS X terminal profile using colors from RailsCasts.
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>ANSIBlueColor</key>
<data>
YnBsaXN0MDDUAQIDBAUGFRZYJHZlcnNpb25YJG9iamVjdHNZJGFyY2hpdmVyVCR0b3AS
AAGGoKMHCA9VJG51bGzTCQoLDA0OVU5TUkdCXE5TQ29sb3JTcGFjZVYkY2xhc3NPECYw
LjQyNzQ1MTAxNDUgMC42MTE3NjQ3MjkgMC43NDUwOTgwNTQ0ABACgALSEBESE1okY2xh
c3NuYW1lWCRjbGFzc2VzV05TQ29sb3KiEhRYTlNPYmplY3RfEA9OU0tleWVkQXJjaGl2