API | Status Codes |
---|---|
[Twitter][tw] | 200, 304, 400, 401, 403, 404, 406, 410, 420, 422, 429, 500, 502, 503, 504 |
[Stripe][stripe] | 200, 400, 401, 402, 404, 429, 500, 502, 503, 504 |
[Github][gh] | 200, 400, 422, 301, 302, 304, 307, 401, 403 |
[Pagerduty][pd] | 200, 201, 204, 400, 401, 403, 404, 408, 500 |
[NewRelic Plugins][nr] | 200, 400, 403, 404, 405, 413, 500, 502, 503, 503 |
[Etsy][etsy] | 200, 201, 400, 403, 404, 500, 503 |
[Dropbox][db] | 200, 400, 401, 403, 404, 405, 429, 503, 507 |
export default function transformer(file, api) { | |
const j = api.jscodeshift; | |
return j(file.source) | |
/* get all imports with the right local name and source */ | |
.find(j.ImportDeclaration, { | |
specifiers: [{ | |
local:{ | |
name:"Helmet" | |
} |
var path = require('path'); | |
var express = require('express'); | |
var webpack = require('webpack'); | |
var config = require('./webpack.config.dev'); | |
var fs = require('fs'); | |
var app = express(); | |
var compiler = webpack(config); | |
app.use(require('webpack-dev-middleware')(compiler, { |
var path = require('path'); | |
var webpack = require('webpack'); | |
module.exports = { | |
devtool: '#inline-source-map', | |
entry: [ | |
'webpack-hot-middleware/client', | |
'./src/index' | |
], | |
output: { |
This is the source for the scripts discussed in https://robots.thoughtbot.com/improving-user-experience-with-shell-scripts
Both scripts are in the bin/
directory of the repo that contains all the markdown documents for blog posts.
Users run bin/server
and everything is automatically set up for them to view a local preview of the blog.
bin/server-setup
is a dependency of bin/server
and is never run directly by users.
Maitre-d is the name of the "blog engine" discussed in the article.
This is the follow up to a post I wrote recently called From Require.js to Webpack - Party 1 (the why) which was published in my personal blog.
In that post I talked about 3 main reasons for moving from require.js to webpack:
- Common JS support
- NPM support
- a healthy loader/plugin ecosystem.
Here I'll instead talk about some of the technical challenges that we faced during the migration. Despite the clear benefits in developer experience (DX) the setup was fairly difficult and I'd like to cover some of the challanges we faced to make the transition a bit easier.
describe MyPresenter, "#my_method" do | |
let(:view) { helper_instance } | |
it "works" do | |
actual = MyPresenter.new("whatever").my_method(view) | |
expect(actual).to include "whatever" | |
end | |
end |
class InMemoryBackend | |
def initialize | |
@counter = 0 | |
@map = {} | |
end | |
def create(record) | |
@counter = @counter + 1 | |
record.id ||= @counter | |
map_for(record)[record.id] = record |
" ---------------------------------------------------------------------------- | |
" vimawesome.com | |
" ---------------------------------------------------------------------------- | |
function! VimAwesomeComplete() abort | |
let prefix = matchstr(strpart(getline('.'), 0, col('.') - 1), '[.a-zA-Z0-9_/-]*$') | |
echohl WarningMsg | |
echo 'Downloading plugin list from VimAwesome' | |
echohl None | |
ruby << EOF | |
require 'json' |