Skip to content

Instantly share code, notes, and snippets.

View originalhat's full-sized avatar
👾
L I M I T L E S S

Devin Brown originalhat

👾
L I M I T L E S S
View GitHub Profile
@originalhat
originalhat / rails-asset-pipeline.md
Last active December 10, 2015 09:19
notes from working with & studying the assets pipeline

assets pipeline

The asset pipeline provides a framework to concatenate and minify or compress JavaScript and CSS assets. It also adds the ability to write these assets in other languages such as CoffeeScript, Sass and ERB.

This is important in a production environment, because it can reduce the number of requests that a browser must make to render a web page.

In previous versions of Rails, all assets were located in subdirectories of public such as images, javascripts and stylesheets. With the asset pipeline, the preferred location for these assets is now the app/assets directory. Files in this directory are served by the Sprockets middleware included in the sprockets gem.

Starting with version 3.1, Rails defaults to concatenating all JavaScript files into one master .js file

@originalhat
originalhat / gist:4448980
Created January 4, 2013 00:55
this works
CatalogUi::Application.configure do
  # Settings specified here will take precedence over those in config/application.rb

  # The production environment is meant for finished, "live" apps.
  # Code is not reloaded between requests
  config.cache_classes = true

  # Full error reports are disabled and caching is turned on
  config.consider_all_requests_local       = false

git rm $(git ls-files -d)

➜  demo git:(master) rm README.rdoc 
➜  demo git:(master) ✗ g s
 D README.rdoc
➜  demo git:(master) ✗ git rm $(git ls-files -d) 
rm 'README.rdoc'
➜  demo git:(master) ✗ g s
D README.rdoc
%li
  = Time.now.in_time_zone("UTC")
%li
  = Time.now.in_time_zone("Mountain Time (US & Canada)")
%li
  = Time.now.in_time_zone("Central Time (US & Canada)")

possible color overlap

primary       =/= main || secondary
first_hover   =/= main || secondary
second_hover  =/= main || secondary
link          =/= main || secondary
@originalhat
originalhat / gist:4536437
Created January 15, 2013 05:34
find hash permutations that are not whitelisted, and are not duplicated.
# combinations that may have the same colors
no_matches = [
  %w(primary link),
  %w(secondary first_hover),
  %w(secondary second_hover),
]

# obtain all color combinations
valid_permutations = STYLE_ATTRIBUTE_NAMES.permutation(2).to_a

Gimmie teh R00by

$ rvm install ruby-2.0.0 

WTF!

...
@originalhat
originalhat / gist:5073545
Last active December 14, 2015 10:39
integrating / adding OpenLayers with / to Rails

Integrating OpenLayers with Rails

What does it take with a vanilla rails app?

Required Files

OpenLayers: downloads

download => OpenLayers-2.12.tar.gz

@originalhat
originalhat / openlayer-rails.md
Last active December 14, 2015 11:18
installing openlayers-rails gem

Include

gem 'openlayer-rails`

Bundle

$ bundle
@originalhat
originalhat / brew-install-openssl-error-13.md
Last active March 27, 2022 00:38
make: *** [install_sw] Error 13, "brew install openssl"

Mo SSL, Mo Problems

Problem

$ brew install openssl
==> Downloading http://openssl.org/source/openssl-1.0.1e.tar.gz
Already downloaded: /Library/Caches/Homebrew/openssl-1.0.1e.tar.gz
==> perl ./Configure --prefix=/usr/local/Cellar/openssl/1.0.1e --openssldir=/usr/local/etc/openssl zlib-dynamic shared darwin64-x86_64-cc
==> make