Since Mavericks stopped using the deprecated ipfw (as of Mountain Lion), we'll be using pf to allow port forwarding.
####1. anchor file
Create an anchor file under /etc/pf.anchors/<anchor file> with your redirection rule like:
| /* 1px hairline, using a GIF */ | |
| background: repeat-x bottom left | |
| url(data:image/gif;base64,R0lGODlhAQACAPABAMjHzP///yH/C1hNUCBEYXRhWE1QAz94cAAh+QQFAAABACwAAAAAAQACAAACAgwKADs=); | |
| background-size: 100% 1px; | |
| /* 1px hairline, using SVG (background-size property not required) */ | |
| background: repeat-x bottom left | |
| url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='1' height='1'><rect fill='#ff0000' x='0' y='0' width='1' height='0.5'/></svg>"); |
Everyone who's reading this, please leave your opinion/ideas/proposals as a comment for a better world!
Most of you guys read Josh' proposals to make components more reusable, I think. Now, reading through this proposals definitely gives a feeling that this is the right way. Anyways, If you haven't read it yet, you should.
So Josh shows us, how angular apps can be structured in a better and more reusable way. Reusability is a very important thing when it comes to software development. Actually the whole angularjs library follows a philosophy of reusability. Which is why you able to make things like:
| this.require || function (global, undefined) { | |
| // The `require` function takes an absolute module identifier and returns | |
| // the `exports` object defined by that module. | |
| function require(moduleId) { | |
| if (!installed[moduleId]) { | |
| log("loader", "required", moduleId); | |
| var exports, module = defines[moduleId]; | |
| if (module) { | |
| module.id = moduleId, module.exports = exports = {}; |
This article has been given a more permanent home on my blog. Also, since it was first written, the development of the Promises/A+ specification has made the original emphasis on Promises/A seem somewhat outdated.
Promises are a software abstraction that makes working with asynchronous operations much more pleasant. In the most basic definition, your code will move from continuation-passing style:
getTweetsFor("domenic", function (err, results) {
// the rest of your code goes here.| # source: http://st-on-it.blogspot.com/2010/01/how-to-move-folders-between-git.html | |
| # First of all you need to have a clean clone of the source repository so we didn't screw the things up. | |
| git clone git://server.com/my-repo1.git | |
| # After that you need to do some preparations on the source repository, nuking all the entries except the folder you need to move. Use the following command | |
| git filter-branch --subdirectory-filter your_dir -- -- all | |
| # This will nuke all the other entries and their history, creating a clean git repository that contains only data and history from the directory you need. If you need to move several folders, you have to collect them in a single directory using the git mv command. |
| function shuffle(array) { | |
| var tmp, current, top = array.length; | |
| if(top) while(--top) { | |
| current = Math.floor(Math.random() * (top + 1)); | |
| tmp = array[current]; | |
| array[current] = array[top]; | |
| array[top] = tmp; | |
| } |
| // Please write an sequence list implements the interface with the required | |
| // time complexity described in the comments. The users can add the same | |
| // element as many times as they want, but it doesn't support the null item. | |
| // You can use any types in .NET BCL but cannot use any 3rd party libraries. | |
| // PS: You don't need to consider the multi-threaded environment. | |
| interface IMyList<T> : IEnumerable<T> | |
| { | |
| // O(1) | |
| // Add an item at the beginning of the list. | |
| void AddFirst(T item); |