... or Why Pipelining Is Not That Easy
Golang Concurrency Patterns for brave and smart.
By @kachayev
| # Usage: | |
| # 1. Put this file in config/locales/grape/zh-CN.yml | |
| # 2. Set load_path in config/application.rb as below: | |
| # config.i18n.load_path += Dir[Rails.root.join('config', 'locales', '**', '*.{rb,yml}').to_s] | |
| zh-CN: | |
| grape: | |
| errors: | |
| format: ! '%{attributes} %{message}' | |
| messages: |
... or Why Pipelining Is Not That Easy
Golang Concurrency Patterns for brave and smart.
By @kachayev
| #!/bin/bash | |
| # Bash script to install latest version of ffmpeg and its dependencies on Ubuntu 12.04 or 14.04 | |
| # Inspired from https://gist.github.com/faleev/3435377 | |
| # Remove any existing packages: | |
| sudo apt-get -y remove ffmpeg x264 libav-tools libvpx-dev libx264-dev | |
| # Get the dependencies (Ubuntu Server or headless users): | |
| sudo apt-get update |
Command Line
pry -r ./config/app_init_file.rb - load your app into a pry session (look at the file loaded by config.ru)pry -r ./config/environment.rb - load your rails into a pry sessionDebugger
| App.Adapter = DS.RESTAdapter.extend | |
| serializer: DS.RESTSerializer.extend | |
| extract: (loader, json, type, record) -> | |
| root = @rootForType(type) | |
| // Embed JSON data in a new object with root element | |
| newJSON = {} | |
| newJSON[root] = json | |
| json = newJSON | |
| // |
| ids = [1,2,3] | |
| def targs(*ids) | |
| puts ids.length | |
| puts ids.flatten.length | |
| end | |
| targs ids | |
| #=> 1 | |
| #=> 3 |