This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| scalar :time, description: "ISOz time" do | |
| parse &Timex.parse(&1.value, "{ISO:Extended:Z}") | |
| serialize &Timex.format!(&1, "{ISO:Extended:Z}") | |
| end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| defmodule User do | |
| schema "users" do | |
| field :email, :string | |
| # ... | |
| many_to_many :companies, Company, join_through: "users_companies" | |
| timestamps() | |
| end | |
| end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| defmodule Identity do | |
| # ... | |
| defp link_user_and_company(user = %User{}, company = %Company{}) do | |
| user = Repo.preload(user, :companies) | |
| companies = user.companies ++ [company] | |
| |> Enum.map(&Ecto.Changeset.change/1) | |
| user | |
| |> Ecto.Changeset.change |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import Cloud from '../cloud'; | |
| import program from 'commander'; | |
| let command, value; | |
| const INC_CMD = 'increment'; | |
| const DEC_CMD = 'decrement'; | |
| program | |
| .description('online incrementer: increment cloud-based counters') | |
| .arguments('<cmd> [args]') |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| { | |
| "name": "incrementor", | |
| "version": "1.0.0", | |
| "description": "increment", | |
| "main": "dist/cloud.js", | |
| "private": true, | |
| "scripts": { | |
| "build:lib": "BABEL_ENV=lib $(npm bin)/babel src/ --ignore=src/__mocks__ --out-dir=dist --source-maps", | |
| "build:bin": "BABEL_ENV=cli $(npm bin)/babel src/bin/ --out-dir=dist/bin --copy-files --source-maps", | |
| "build": "rm -rf dist/ && npm run build:lib && npm run build:bin", |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| { | |
| "version": "0.2.0", | |
| "configurations": [{ | |
| "type": "node", | |
| "request": "launch", | |
| "name": "Debug Increment Command", | |
| "cwd": "${workspaceRoot}", | |
| "sourceMaps": true, | |
| "preLaunchTask": "npm: build", | |
| "program": "${workspaceRoot}/dist/bin/app", |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env node | |
| require('./app.js'); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Show hidden characters
| { | |
| "presets": [ | |
| ["env", { | |
| "targets": {"node": "8.0"}, | |
| "useBuiltIns": true | |
| }] | |
| ], | |
| "plugins": [ | |
| "transform-object-rest-spread" | |
| ] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| { | |
| "version": "0.2.0", | |
| "configurations": [ | |
| { | |
| "name": "Launch tests", | |
| "type": "go", | |
| "request": "launch", | |
| "mode": "test", | |
| "program": "${workspaceRoot}" | |
| }, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env bash | |
| set -e | |
| main() { | |
| previous_file="$1" | |
| file_to_edit=`select_file $previous_file` | |
| if [ -n "$file_to_edit" ] ; then | |
| "$EDITOR" "$file_to_edit" | |
| main "$file_to_edit" |