Skip to content

Instantly share code, notes, and snippets.

View BlakeWilliams's full-sized avatar
💭
building things, probably

Blake Williams BlakeWilliams

💭
building things, probably
View GitHub Profile
def show
@post = Post.find params[:id]
redirect_to @post if params[:id] != @post.to_param
end
@BlakeWilliams
BlakeWilliams / gist:4287055
Created December 14, 2012 17:14
Basic responsive setup
.visible-desktop {
display: inherit;
}
.visible-tablet {
display: none !important;
}
.visible-mobile {
display: none !important;
<div id="container">
<div id="left">
{{render sidebar}}
</div>
<div id="outlet">
{{outlet}}
</div>
</div>
/*global App*/
window.App = Ember.Application.create();
// Router
App.Router.map(function() {
this.resource('inventory', function(){
this.route('review');
this.resource('vehicle', { path: '/vehicle/:stock_no' }, function(){
UI.DatePicker = Ember.View.extend UI.Widget,
uiType: 'datepicker'
uiOptions: ['disabled', 'contrainInput', 'dateFormat', 'defaultDate', 'maxDate', 'minDate', ]
uiEvents: ['create', 'beforeShow', 'beforeShowDay', 'onChangeMonthYear'
'onClose', 'onSelect']
attributeBindings: ['type', 'value', 'placeholder']
type: 'text'
tagName: 'input'
@BlakeWilliams
BlakeWilliams / pickadate.coffee
Last active December 12, 2015 00:29
Remove useless parts.
App.PickADate = Ember.View.extend
attributes: ['monthsFull', 'monthsShort', 'weekdaysFull', 'weekdaysShort',
'monthPrev', 'monthNext', 'showMonthsFull', 'showWeekdaysShort', 'today',
'clear', 'format', 'formatSubmit', 'hiddenSuffix', 'firstDay', 'monthSelector',
'yearSelector', 'dateMin', 'dateMax', 'datesDisabled', 'disablePicker']
events: ['onOpen', 'onClose', 'onSelect', 'onStart']
attributeBindings: ['type', 'value', 'placeholder']
type: 'text'
tagName: 'input'
@BlakeWilliams
BlakeWilliams / PickADate.js
Last active December 15, 2015 21:19
Custom Ember view for the jQuery PickADate plugin.
App.PickADate = Ember.View.extend({
attributes: ['monthsFull', 'monthsShort', 'weekdaysFull', 'weekdaysShort',
'monthPrev', 'monthNext', 'showMonthsFull', 'showWeekdaysShort', 'today',
'clear', 'format', 'formatSubmit', 'hiddenSuffix', 'firstDay', 'monthSelector',
'yearSelector', 'dateMin', 'dateMax', 'datesDisabled', 'disablePicker'],
events: ['onOpen', 'onClose', 'onSelect', 'onStart'],
attributeBindings: ['type', 'value', 'placeholder'],
type: 'text',
tagName: 'input',
App.PickADate = Ember.View.extend({
attributes: ['monthsFull', 'monthsShort', 'weekdaysFull', 'weekdaysShort',
'monthPrev', 'monthNext', 'showMonthsFull', 'showWeekdaysShort', 'today',
'clear', 'format', 'formatSubmit', 'hiddenSuffix', 'firstDay', 'monthSelector',
'yearSelector', 'dateMin', 'dateMax', 'datesDisabled', 'disablePicker'],
events: ['onOpen', 'onClose', 'onSelect', 'onStart'],
tagName: 'input',
classNames: 'pickadate',
PS1="\u:\W \[\e[1;33m\]⚡\[\e[0m\] "
@BlakeWilliams
BlakeWilliams / gist:5458208
Created April 25, 2013 08:00
Rake task for minitest-rails stats. Slightly incomplete.
task :stats => "test:statssetup"
namespace :test do
task :statssetup do
require 'rails/code_statistics'
['controllers', 'helpers', 'models'] .each do |type|
dir = "test/#{type}"
::STATS_DIRECTORIES << ["#{type} tests", dir]
::CodeStatistics::TEST_TYPES << "#{type} tests"
end