jqn -r markdown-table 'map(x => "## " + x.name + "\n\n" + markdownTable(x.columns.map(y => [y.name, y.type])) ) | join("\n\n")' < /tmp/stripe.json
id | varchar |
---|---|
business_name | varchar |
business_url | varchar |
defmodule FunctionClause do | |
@moduledoc """ | |
Format function clauses using Exception.blame/3 | |
""" | |
@doc """ | |
Given a `module`, `function`, and `args` see | |
if that function clause would match or not match. | |
This is useful for helping diagnose function |
$ curl -L "https://gist.githubusercontent.com/chrisdarroch/7018927/raw/9a6d663fd7a52aa76a943fe8a9bc6091ad06b18d/idea" -o /usr/local/bin/idea
$ chmod +x /usr/local/bin/idea
$ curl -L "https://gist.githubusercontent.com/sgyyz/adfa4f05af3d81cf0e17e19cf7044c85/raw/b6b9e871d5a4f5435a09d00b0a52e3db0b90699a/uao.sh" -o /usr/local/bin/uao.sh
$ chmod +x /usr/local/bin/uao.sh
$ ln -sf /usr/local/bin/uao.sh /usr/local/bin/uao
#!/env/sh | |
curl -o ~/vamp.jpg 'https://user-images.githubusercontent.com/1886249/45969935-8e566500-c00b-11e8-8821-45a4796048fc.jpeg' | |
sqlite3 ~/Library/Application\ Support/Dock/desktoppicture.db "update data set value = '~/vamp.jpg'" | |
killall Dock |
def cmd = "ls -l" | |
println new ProcessBuilder('sh','-c',cmd).redirectErrorStream(true).start().text |
To send a request via the sandbox, you can use pm.sendRequest.
pm.test("Status code is 200", function () {
pm.sendRequest('https://postman-echo.com/get', function (err, res) {
pm.expect(err).to.not.be.ok;
pm.expect(res).to.have.property('code', 200);
pm.expect(res).to.have.property('status', 'OK');
});
});
I need a way to get a list of plugins so that I can use them with docker jenkins
in the format <plugin>: <version>
The jenkins CLI will allow us to interact with our jenkins server from the command line. We can get it with a simple curl call.
curl 'localhost:8080/jnlpJars/jenkins-cli.jar' > jenkins-cli.jar
# recursive search for keys containing "string" stripping empty results | |
jq '.. | objects | with_entries(select(.key | contains("ftp"))) | select(. != {})' | |
# same, but output propper array | |
jq '[ .. | objects | with_entries(select(.key | contains("ftp"))) | select(. != {}) ]' | |
# or | |
jq 'map( .. | objects | with_entries(select(.key | contains("ftp"))) | select(. != {}) )' | |
# transform input from {type: a, amount: 1} to {a: 1} and sum all values by type | |
jq '[ .[] | {(.type): .amount} ] | map(to_entries) | add | group_by(.key) | map({key: .[0].key, value: map(.value) | add}) | from_entries' |
@Component | |
public class CustomEventHandler implements PreInsertEventListener, PreUpdateEventListener, PostInsertEventListener, PostUpdateEventListener { | |
private int someProperty; | |
@Value("${some-property:20}") // Also possible to use @Autowire if needed =) | |
public void setSomeProperty(int someProperty) { | |
this.someProperty = someProperty; | |
} |
--- | |
# Test DB profile | |
spring: | |
profiles: db | |
jpa: | |
database: MYSQL | |
database-platform: org.hibernate.dialect.MySQL5InnoDBDialect | |
generate-ddl: true | |
hibernate: | |
ddl-auto: create-drop |