Attention: the list was moved to
https://github.com/dypsilon/frontend-dev-bookmarks
This page is not maintained anymore, please update your bookmarks.
Attention: the list was moved to
https://github.com/dypsilon/frontend-dev-bookmarks
This page is not maintained anymore, please update your bookmarks.
These are instructions to setup Postgres.app to allow connections over unix sockets. These instructions were written for Mac OS X 10.8 (Mountain Lion).
~/Library/Application Support/Postgres.~/Library/Application Support/Postgres/var/postgresql.conf in your favorite text editor.unix_socket_directory = '' and change it to unix_socket_directory = '/var/pgsql_socket'/var/pgsql_socket if it doesn't exist.chmod 770 /var/pgsql_socket (may need to be run with sudo)chown root:staff /var/pgsql_socket (may need to be run with sudo)| # config/initializers/source_maps.rb | |
| if Rails.env.development? | |
| module CoffeeScript | |
| class SourceMapError < StandardError; end; | |
| class << self | |
| def compile script, options | |
| script = script.read if script.respond_to?(:read) |
| // Marionette.Gauntlet v0.0.0 | |
| // -------------------------- | |
| // | |
| // Build wizard-style workflows with an event-emitting state machine | |
| // Requires Backbone.Picky (http://github.com/derickbailey/backbone.picky) | |
| // | |
| // Copyright (C) 2012 Muted Solutions, LLC. | |
| // Distributed under MIT license | |
| Marionette.Gauntlet = (function(Backbone, Picky, Marionette, $, _){ |
| # in controller | |
| # for local files | |
| send_file '/path/to/file', :type => 'image/jpeg', :disposition => 'attachment' | |
| # for remote files | |
| require 'open-uri' | |
| url = 'http://someserver.com/path/../filename.jpg' | |
| data = open(url).read | |
| send_data data, :disposition => 'attachment', :filename=>"photo.jpg" |
| define([ | |
| "underscore", | |
| "backbone", | |
| "marionette", | |
| "vent" | |
| ], | |
| /** | |
| * Creates the primary `Marionette.Application` object that runs the admin framework. Provides a central point | |
| * from which all other sub-applications are started, shown, hidden, and stopped. |
| require 'date' | |
| # Actually doesn't matter WHAT you choose as the epoch, it | |
| # won't change the algorithm. Just don't change it after you | |
| # have cached computed scores. Choose something before your first | |
| # post to avoid annoying negative numbers. Choose something close | |
| # to your first post to keep the numbers smaller. This is, I think, | |
| # reddit's own epoch. | |
| $our_epoch = Time.local(2005, 12, 8, 7, 46, 43).to_time |
| require 'RMagick' | |
| TOP_N = 10 # Number of swatches | |
| # Create a 1-row image that has a column for every color in the quantized | |
| # image. The columns are sorted decreasing frequency of appearance in the | |
| # quantized image. | |
| def sort_by_decreasing_frequency(img) | |
| hist = img.color_histogram | |
| # sort by decreasing frequency |
| /*! | |
| * quantize.js Copyright 2008 Nick Rabinowitz. | |
| * Licensed under the MIT license: http://www.opensource.org/licenses/mit-license.php | |
| */ | |
| // fill out a couple protovis dependencies | |
| /*! | |
| * Block below copied from Protovis: http://mbostock.github.com/protovis/ | |
| * Copyright 2010 Stanford Visualization Group | |
| * Licensed under the BSD License: http://www.opensource.org/licenses/bsd-license.php |
| class Avatar < ActiveRecord::Base | |
| attr_accessor :content_type, :original_filename, :image_data | |
| before_save :decode_base64_image | |
| has_attached_file :image, | |
| PAPERCLIP_CONFIG.merge( | |
| :styles => { | |
| :thumb => '32x32#', | |
| :medium => '64x64#', |