This gist shows how to create a GIF screencast using only free OS X tools: QuickTime, ffmpeg, and gifsicle.
To capture the video (filesize: 19MB), using the free "QuickTime Player" application:
Get Homebrew installed on your mac if you don't already have it
Install highlight. "brew install highlight". (This brings down Lua and Boost as well)
#!/bin/bash | |
file=$1 | |
test -z $file && echo "file required." 1>&2 && exit 1 | |
git filter-branch -f --index-filter "git rm -r --cached $file --ignore-unmatch" --prune-empty --tag-name-filter cat -- --all | |
git ignore $file | |
git add .gitignore | |
git commit -m "Add $file to .gitignore" |
/** | |
* Example webpack.config.js for an AMD project (or AMD + CJS mixed project). | |
* This file should be at the root of your project. | |
* | |
* This can then be used in combination with Karma as well | |
* Just load this file and pass it to karma.webpack key | |
* (see https://github.com/webpack/karma-webpack#alternative-usage) | |
* | |
* This example is a bit extreme. Typically in webpack, you don't need much | |
* configuration if you have nicely behaving code and work with correctly |
I'm a fan of MiniTest::Spec. It strikes a nice balance between the simplicity of TestUnit and the readable syntax of RSpec. When I first switched from RSpec to MiniTest::Spec, one thing I was worried I would miss was the ability to add matchers. (A note in terminology: "matchers" in MiniTest::Spec refer to something completely different than "matchers" in RSpec. I won't get into it, but from now on, let's use the proper term: "expectations").
Let's take a look in the code (I'm specifically referring to the gem, not the standard library that's built into Ruby 1.9):
# minitest/spec.rb
module MiniTest::Expectations
//If you need to spy or stub the global require function in node.js, don't try to spy on the require function itself..you aren't going //to be successful. | |
//Instead, spy on the require.extensions object like so: | |
var spies = {}; | |
spies.require = sinon.spy(require.extensions, '.js'); | |
//Then when you need to assert you can do stuff like: | |
spies.require.firstCall.args[1].should.include("path/to/some/module"); |
# Start by stopping the built-in Apache, if it's running, and prevent it from starting on boot.
# This is one of very few times you'll need to use sudo:
sudo launchctl unload /System/Library/LaunchDaemons/org.apache.httpd.plist 2>/dev/null
# We need to tap homebrew-dupes because "homebrew-apache/httpd22" relies on "homebrew-dupes/zlib"
Real world application with a lot of pages (or "screens") have to deal with problem managing the pages' DOM and memory efficiently and at the same provide a nice smooth transition effect between pages. This is not a real problem when you do it in native apps since Android or iOS already handle the hard work for you, but when come to JavaScript, HTML, and CSS, running on mobile browsers, this is the real challenge.
There are 2 common approaches to solve this problem:
display
) to transit between pages.const React = require("react"); | |
const ReactDOM = require("react-dom"); | |
const reducer = (state, action) => { | |
switch (action) { | |
case "INCREMENT": | |
return state + 1; | |
case "DECREMENT": | |
return state - 1; | |
default: |