To setup your computer to work with *.test domains, e.g. project.test, awesome.test and so on, without having to add to your hosts file each time.
- Homebrew
- Mountain Lion -> High Sierra
mkdir tile_cache | |
cd tile_cache | |
# Download Open Street Map Data | |
mkdir osm_data | |
cd osm_data | |
wget http://download.geofabrik.de/europe/great-britain/england/devon-latest.osm.pbf | |
wget http://download.geofabrik.de/europe/great-britain/england-latest.osm.pbf | |
cd .. |
# Changing terminal color in MacOSX when SSHing (so you know at a glance that you're no longer in Kansas) | |
# Adapted from http://www.rngtng.com/2011/01/14/mac-os-x-terminal-visual-indication-for-your-ssh-connection/ | |
# 1. Create a theme in your terminal setting with the name "SSH" and the desired colors, background, etc. | |
# 2. Add this to your .bash_profile (or .bashrc, I always forget the difference ;)) | |
# 3. Optional but useful: in the terminal, go to Settings > Startup and set "New tabs open with" to | |
# "default settings" (otherwise, if you open a new tab from the changed one, you get a local tab with | |
# the SSH colors) | |
function tabc() { | |
NAME=$1; if [ -z "$NAME" ]; then NAME="Default"; fi # if you have trouble with this, change |
require 'celluloid/autostart' | |
class Cook | |
include Celluloid | |
def produce(manager) | |
manager.async.inform("produced") | |
end | |
end |
To setup your computer to work with *.test domains, e.g. project.test, awesome.test and so on, without having to add to your hosts file each time.
{ | |
{I have|I've} been {surfing|browsing} online more than {three|3|2|4} hours today, yet I never found any interesting article like yours. {It's|It | |
is} pretty worth enough for me. {In my opinion|Personally|In my view}, if all {webmasters|site owners|website owners|web owners} and bloggers made good content as | |
you did, the {internet|net|web} will be {much more|a lot more} | |
useful than ever before.| | |
I {couldn't|could not} {resist|refrain from} commenting. {Very well|Perfectly|Well|Exceptionally well} written!| | |
{I will|I'll} {right away|immediately} {take hold of|grab|clutch|grasp|seize|snatch} | |
your {rss|rss feed} as I {can not|can't} {in finding|find|to find} your {email|e-mail} subscription {link|hyperlink} or {newsletter|e-newsletter} service. Do {you have|you've} any? | |
{Please|Kindly} {allow|permit|let} me {realize|recognize|understand|recognise|know} {so that|in order that} I {may just|may|could} subscribe. | |
Thanks.| |
# RangeCountTree | |
# A bst variant for fast retrieval of count of ranges which are intersecting given n ranges | |
# | |
# Creator : Shadab Ahmed | |
# | |
# Each node stores a range and the count of intervals which intersect with the range. | |
# | |
# We just follow these rules: | |
# 1. Any range which is greater than the current range is stored in the right subtree | |
# 2. Any range which is smaller than the current range is stored in the left subtree |
// Time difference function | |
function timeDiff(start, end) { | |
//today, now! | |
//Get the diff | |
var diff = end - start; | |
//Create numbers for dividing to get hour, minute and second diff | |
var units = [ | |
1000 * 60 * 60 *24, | |
1000 * 60 * 60, | |
1000 * 60, |
One of the problems of big ActiveRecord models is their low cohesion. In Rails we group behaviour around the entities of the domain we're modelling. If we use only ActiveRecord models for that, we'll probably end up with classes full of actions, in most cases, completely unrelated to each other (except for the fact that they act on the same domain entity).
To illustrate the issue let's imagine a big Post
AR model of a blog application. In this app, users can add tags to their posts. Since this is the only class with this ability, I decide to put the related logic in the Post
model itself. For this, presumably at the beginning of the file, I write a couple of has_many
entries for tags
and taggings
. Then, fifty lines below, along with the rest of scopes, I add one more to find posts by tag name. A couple of hundred lines later, I put a virtual attribute tag_list
which will be used to update the associations from a string of tag names separated by commas. Fin
This is a brain dump of my experience trying to get something going with Ember.js. My goal was to get to know the ins and outs of the framework by completing a pretty well defined task that I had lots of domain knowledge about. In this case reproducing a simple Yammer feed. As of this time, I have not been able to complete that task. So this is a subjective rundown of the things I think make it difficult to get a handle on Ember. NOTE: My comments are addressing the Ember team and giving suggestions on what they could do to improve the situation.
The new guides have pretty good explanation of the various parts of the framework; routers, models, templates, views. But it's not clear how they all get strapped together to make something that works. There are snippets of examples all over the place like:
App.Router.map(function() {
match('/home').to('home');
});