This guide is no longer being updated and instead has moved to GitHub (click and scroll down)
- Setting Up and Installing Software
- Building your keymap and keyboard firmware
To improve collaboration this guide is now available on GitHub.
| # Ajax testing with ruby and capybara | |
| # | |
| # Add this to spec/support | |
| # | |
| # When a link or button starts an ajax request, instead of use Capybara | |
| # click_link, click_button and click_link_or_button methods use click_ajax_link, | |
| # click_ajax_button and click_ajax_link_or_button methods. You can still use | |
| # capybara methods and right after it, call wait_for_ajax method. | |
| # | |
| # This methods will wait until Capybara.default_wait_time for the ajax request |
| # This command receives a file as param, upload it to upl.io and copy the url to the clipboard | |
| # | |
| # install: copy this code to your .bashrc or .zshrc | |
| # dependencies: curl and xclip | |
| # example: $ upload ~/Images/image.png | |
| upload_file() { | |
| echo 'Uploading...' | |
| url=`curl http://upl.io -F file=@$1 -s -f` | |
| curl_response=$? |
| .directive('equals', function() { | |
| return { | |
| restrict: 'A', // only activate on element attribute | |
| require: '?ngModel', // get a hold of NgModelController | |
| link: function(scope, elem, attrs, ngModel) { | |
| if(!ngModel) return; // do nothing if no ng-model | |
| // watch own value and re-validate on change | |
| scope.$watch(attrs.ngModel, function() { | |
| validate(); |
| class API::V1::BaseController < ApplicationController | |
| skip_before_filter :verify_authenticity_token | |
| before_filter :cors_preflight_check | |
| after_filter :cors_set_access_control_headers | |
| def cors_set_access_control_headers | |
| headers['Access-Control-Allow-Origin'] = '*' | |
| headers['Access-Control-Allow-Methods'] = 'POST, GET, PUT, DELETE, OPTIONS' |
| function zrun() { | |
| SPEC_FILE=$1 | |
| SPEC_LOG=/tmp/rspec.log | |
| if [ $SPEC_FILE ]; then | |
| rspec $SPEC_FILE 2>&1 | tee $SPEC_LOG | |
| else | |
| cat $SPEC_LOG | grep "^rspec" | cut -d ' ' -f 2 | xargs rspec 2>&1 | tee $SPEC_LOG | |
| fi | |
| } |
| class Foo | |
| attr_reader :bar, :buzz | |
| def initialize | |
| @bar = 1 | |
| @buzz = 1 | |
| end | |
| def add | |
| @bar += 1 |
| echo fs.inotify.max_user_watches=524288 | sudo tee -a /etc/sysctl.conf && sudo sysctl -p |