$ zmv -n '(.)(<->)(.[^.]#)' '$1$(($2+1))$3' # would rename x.0001.y to x.2.y. $ zmv -n '(.0#)(<->)(.[^.]#)' '$1$(($2+1))$3'
$ zmv '*' '${(L)f}'
$ autoload zmv
#!/bin/bash | |
set -e | |
set -u | |
set -o pipefail | |
prefix="[email protected]:mygroup" | |
target="$1" | |
shift |
$ zmv -n '(.)(<->)(.[^.]#)' '$1$(($2+1))$3' # would rename x.0001.y to x.2.y. $ zmv -n '(.0#)(<->)(.[^.]#)' '$1$(($2+1))$3'
$ zmv '*' '${(L)f}'
$ autoload zmv
FROM traefik:camembert | |
ADD traefik.toml . | |
EXPOSE 80 | |
EXPOSE 8080 | |
EXPOSE 443 |
query IntrospectionQuery { | |
__schema { | |
queryType { name } | |
mutationType { name } | |
subscriptionType { name } | |
types { | |
...FullType | |
} | |
directives { |
import * as React from 'react'; | |
import { Component } from 'react'; | |
export default function HOCBaseRender<Props, State, ComponentState>( | |
Comp: new() => Component<Props & State, ComponentState>) { | |
return class HOCBase extends Component<Props, State> { | |
render() { | |
return <Comp {...this.props} {...this.state}/>; | |
} | |
} |
class Some<A> implements Optional<A> { | |
constructor(private a: A) { | |
} | |
getOrElse(a: A) { | |
return this.a; | |
} | |
map<B>(func: (a: A) => B) { | |
return Optional(func(this.a)); | |
} | |
match<B>(cases: { |
# ... | |
namespace :deploy do | |
desc 'Restart application' | |
task :restart => ["eye:reload", "eye:restart"] | |
after :published, :restart | |
end |
'use strict'; | |
module.exports = function CustomError(message, extra) { | |
Error.captureStackTrace(this, this.constructor); | |
this.name = this.constructor.name; | |
this.message = message; | |
this.extra = extra; | |
}; | |
require('util').inherits(module.exports, Error); |
# Output json-esque output for logstash to parse easily. | |
http { | |
# ... | |
log_format logstash_json '{"@timestamp": "$time_iso8601", ' | |
'"remote_addr": "$remote_addr", ' | |
'"remote_user": "$remote_user", ' | |
'"body_bytes_sent": "$body_bytes_sent", ' | |
'"request_time": "$request_time", ' |
# DCI EXAMPLE IN RUBY (with some prototype elements) | |
# Blog post: https://www.ludyna.com/oleh/dci-example-in-ruby | |
# | |
# More info: | |
# | |
# Creator of MVC & DCI, Trygve Reenskaug: DCI: Re-thinking the foundations of | |
# object orientation and of programming | |
# http://vimeo.com/8235394 | |
# | |
# James Coplien: Why DCI is the Right Architecture for Right Now |