Skip to content

Instantly share code, notes, and snippets.

INSERT INTO `new_table` (`id`,`name`,`created_at`) VALUES (3,'bob smith','2017-11-26');
INSERT INTO `new_table` (`id`,`name`,`created_at`) VALUES (4,'bob jones','2017-11-26');
INSERT INTO `new_table` (`id`,`name`,`created_at`) VALUES (5,'bob ames','2017-11-26');
INSERT INTO `new_table` (`id`,`name`,`created_at`) VALUES (6,'adam','2017-11-27');
INSERT INTO `new_table` (`id`,`name`,`created_at`) VALUES (7,'larry','2017-11-27');
INSERT INTO `new_table` (`id`,`name`,`created_at`) VALUES (8,'hank','2017-11-29');
class Mutations::SigninUser < GraphQL::Function
SigninPayload = GraphQL::ObjectType.define do
name 'SigninPayload'
field :token, types.String, description: 'A JWT representing the authenticated user'
field :user, Types::User, description: 'The authenticated user
end
type SigninPayload
@dnd
dnd / commit.md
Created September 11, 2017 01:53 — forked from abravalheri/commit.md
RFC: Git Commit Message Guidelines

Commit Message Guidelines

In the last few yers, the number of programmers concerned about writting structured commit messages had dramatically grown. As exposed by Tim Pope in article readable commit messages are easy to follow when looking through the project history. Moreover the AngularJS contributing guides introduced conventions that can be used by automation tools to automatically generate useful documentation, or by developpers during debbuging process.

This document borrow some concepts, conventions and even text mainly from these two sources, extending them in order to provide a sensible guideline for writing commit messages.

@dnd
dnd / yml
Created August 7, 2017 21:33
migrate-db:
salt.state:
- tgt: {{salt.saltutil.runner('app.db_minion', app='board', environment=deploy_env)}}
- sls:
- app.board.db
- pillar:
board_deploy_revision: {{revision}}
- require:
- salt: refresh_pillar
- salt: sync_all
validation(with: {form: true}) do
configure do
def non_destroyed_items?(value)
form.items.detect {|i| !i._destroy}
end
def item_sum?(value)
isum = form.items.reduce(0) do |sum, item|
sum += item._destroy ? 0 : item.amount
end
@dnd
dnd / production environment results.json
Created February 2, 2016 14:10
Different scoring for same documents
// There are many more users that have been snipped out of this, but they all score exactly the same matching the first name 'lori'
[
{
"attributes": {
"first_name": "Lori",
"last_name": "Packer",
"phone": null,
"created_at": "2015-01-14T21:44:47.000Z",
"updated_at": "2015-01-14T21:55:08.000Z",
"role_ids": [
@dnd
dnd / handlers.json
Created September 11, 2015 23:19
Sensu InfluxDB 0.9 UDP Line Protocol
{
"handlers": {
"metrics": {
"type": "set",
"handlers": ["influxdb_udp"]
},
"influxdb_udp": {
"type": "udp",
"mutator": "influxdb_line_protocol",
"socket": {
@dnd
dnd / auth.log
Last active September 4, 2015 14:53
filter_syslog.conf
Sep 4 09:30:24 lb1 sshd[29552]: Accepted publickey for steve from 72.64.121.61 port 35652 ssh2: RSA 70:74:08:63:33:7f:28:c2:8c:65:da:70:51:11:fd:c1
Sep 4 10:10:41 app1 sudo: pam_unix(sudo:auth): authentication failure; logname=steve uid=1006 euid=0 tty=/dev/pts/1 ruser=events rhost= user=events
Sep 4 10:14:35 app1 sshd[9274]: Failed password for events from 72.64.121.61 port 38268 ssh2
Sep 4 10:14:37 app1 sshd[9274]: Connection closed by 72.64.121.61 [preauth]
echo -n "memory_used,host=com.somedomain.something-whatever,metric=memory_metrics value=123 1439500070" | nc -u -w1 192.168.217.87 8090
{
"checks": {
"load_metrics": {
"type": "metric",
"command": "metrics-load.rb",
"interval": 1,
"subscribers": ["all"],
"handlers": ["show", "debug"]
}
}