Skip to content

Instantly share code, notes, and snippets.

View scottbaggett's full-sized avatar
:electron:

Scott scottbaggett

:electron:
View GitHub Profile
GIT
remote: git://github.com/wr0ngway/graylog2_exceptions.git
revision: 797924acd1aa89852605230812d8cfd27da90969
specs:
graylog2_exceptions (1.3.0)
gelf (~> 1.3)
GIT
remote: https://github.com/fog/fog.git
revision: 6132354b56109a3891a84a3981329c675632e664
Temple::InvalidExpression in Application#index
Showing /Users/scottbaggett/code/Seventy-Two-Site/app/views/layouts/mobile.slim where line #26 raised:
Generator supports only core expressions - found [:html, :tag, "li", [:html, :attrs], [:multi, [:newline], [:html, :tag, "img", [:html, :attrs, [:html, :attr, "class", [:static, "retina"]], [:html, :attr, "width", [:multi, [:static, "320"]]], [:html, :attr, "height", [:multi, [:static, "245"]]], [:html, :attr, "src", [:multi, [:multi, [:escape, true, [:dynamic, "project.cover_image.cover_image.mobile_home_thumb.url"]], [:multi]]]]], [:multi, [:newline]]], [:html, :tag, "div", [:html, :attrs, [:html, :attr, "class", [:static, "details"]]], [:multi, [:newline], [:html, :tag, "div", [:html, :attrs, [:html, :attr, "class", [:static, "logo"]]], [:multi, [:newline], [:html, :tag, "img", [:html, :attrs, [:html, :attr, "class", [:static, "retina"]], [:html, :attr, "width", [:multi, [:static, "46"]]], [:html, :attr, "src", [:multi, [:static, "/assets/mobile/fpo/nikelog
@scottbaggett
scottbaggett / gist:3769086
Created September 23, 2012 06:29
jQuery column manager
jQuery(document).ready(function($) {
var CollManag = (function() {
var $ctCollContainer = $('#ct-coll-container'),
collCnt = 1,
init = function() {
changeColCnt();
initEvents();
initPlugins();
},
changeColCnt = function() {
Never hardcode sensitive information (account credentials, passwords, etc.) into your code. Instead, create a file to store that information as environment variables (key/value pairs), and exclude the file from your source code management system. For example, in terms of Git, .gitignore that file:
-bash> echo "config/app_environment_variables.rb" >> .gitignore
config/app_environment_variables.rb
ENV['HTTP_USER'] = 'devuser'
ENV['HTTP_PASS'] = 'devpass'
As well, add the following lines to config/environment.rb, between the require line, and the Application.initialize line:
# Load the app's custom environment variables here, so that they are loaded before environments/*.rb
@scottbaggett
scottbaggett / deployer.rake
Created September 28, 2012 23:03
Rake task to copy local files to remote server via FTP
# Rake task to copy local files to remote server via FTP
# required credentials.yml file, that contains keys:
# server, username, password
require "net/ftp"
require "yaml"
class FTPClient
attr_reader :remote_path
@scottbaggett
scottbaggett / gist:3802547
Created September 28, 2012 23:10
running rake tasks from inside another rake task
task :build_all do
[ :debug, :release ].each do |t|
$build_type = t
Rake::Task["build"].reenable
Rake::Task["build"].invoke
end
end
@scottbaggett
scottbaggett / gist:3949763
Created October 25, 2012 00:16
center items inside edge animation
// Add the 'center' class to any element you want to center on resize.
// Using this in combination with the scale-background mode will make backgrounds
// work on all sizes, Yay!
var $center_items = $(".center");
var center;
window.resize = function() {
console.log("resize");
$center_items.each(function(i,el){
# db/migrations/20120118012543_create_site_configuration.rb
class CreateSiteConfigurations < ActiveRecord::Migration
def change
create_table :site_configurations do |t|
t.string :key
t.text :value
t.string :form_type
t.string :form_collection_command
@scottbaggett
scottbaggett / gist:4559573
Last active December 11, 2015 06:28
sublime text preferences
{
"color_scheme": "Packages/User/Espresso Soda.tmTheme",
"detect_indentation": true,
"file_exclude_patterns":
[
".scss",
".DS_Store",
".sassc",
".scssc",
"*.css.sassc",
@scottbaggett
scottbaggett / gist:4989064
Created February 19, 2013 19:32
api call
create_invite: (entity_id, callback=->) =>
$.ajax
type: "PUT"
url: "#{@address}/invites/entities/#{entity_id}"
success: callback
error: (event) ->
log "LOG:","createinvite_error", event