- windows:
<path to chrome>/chrome.exe --remote-debugging-port=9222
- macOS:
/Applications/Google\ Chrome.app/Contents/MacOS/Google\ Chrome --remote-debugging-port=9222
- linux:
google-chrome --remote-debugging-port=9222
#!/bin/bash | |
starttmux() { | |
if [ -z "$HOSTS" ]; then | |
echo -n "Please provide of list of hosts separated by spaces [ENTER]: " | |
read HOSTS | |
fi | |
local hosts=( $HOSTS ) |
package main | |
import ( | |
"context" | |
"flag" | |
"fmt" | |
"log" | |
"net/http" | |
"os" | |
"os/signal" |
// original gist | |
const shuffleArray = arr => arr.sort(() => Math.random() - 0.5); | |
// fully random by @BetonMAN | |
const shuffleArray = arr => arr | |
.map(a => [Math.random(), a]) | |
.sort((a, b) => a[0] - b[0]) | |
.map(a => a[1]); | |
shuffleArray([1, 2, 3]) //[3, 1, 2] |
This post was inspired by this post on why the author thinks "Ruby is still great" and this tweet stating that Shopify (and others) are successful because of Rails, not despite it.
Now, let me first give a little background. I've been a Rails programmer since late 2006. Before Rails I went through PHP, ASP and ASP.NET (like most people at the time).
Back pre-2010, Rails was a force-multiplier, and to some degree still is. It provided a completely new way to do web development, including code generation and all the necessary tooling out of the box. The deployment story was sad until Heroku came on the scene, but we suffered through it because Rails solved a real problem.
After over 10 years of dealing with Rails' problems, I'm not so enthusiastic anymore. I believe it is impossible to write a high quality application in Rails. By high quality I mean it satis
Article by Faruk Ateş, [originally on KuraFire.net][original] which is currently down
One of the most commonly overlooked and under-refined elements of a website is its pagination controls. In many cases, these are treated as an afterthought. I rarely come across a website that has decent pagination, and it always makes me wonder why so few manage to get it right. After all, I'd say that pagination is pretty easy to get right. Alas, that doesn't seem the case, so after encouragement from Chris Messina on Flickr I decided to write my Pagination 101, hopefully it'll give you some clues as to what makes good pagination.
Before going into analyzing good and bad pagination, I want to explain just what I consider to be pagination: Pagination is any kind of control system that lets the user browse through pages of search results, archives, or any other kind of continued content. Search results are the o
This post is also on my blog, since Gist doesn't support @ notifications.
Components are taking center stage in Ember 2.0. Here are some things you can do today to make the transition as smooth as possible:
- Use Ember CLI
- In general, replace views + controllers with components
- Only use controllers at the top-level for receiving data from the route, and use
Ember.Controller
instead ofEmber.ArrayController
orEmber.ObjectController
- Fetch data in your route, and set it as normal properties on your top-level controller. Export an
Ember.Controller
, otherwise a proxy will be generated. You can use Ember.RSVP.hash to simulate setting normal props on your controller.
// Controller | |
App.SomeController = Ember.ArrayController.extend({ | |
items: [] | |
}); | |
// View | |
App.SomeView = Ember.View.extend({ | |
// this will be run once the didInsertElement event occurs, and any time an item is added | |
initIsotope: function(){ | |
// use the run loop to execute after rendering is complete |