This file contains 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
const net = require("net"); | |
const { spawn } = require("child_process"); | |
const client = new net.Socket(); | |
client.connect(9000, "192.168.1.26", function () { | |
console.log("Connected to button server"); | |
}); | |
const unmuteScript = ` |
This file contains 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 MyAppWeb.Admin.AccountView do | |
use MyAppWeb, :view | |
def render("page_title", assigns) do | |
page_title(view_template(assigns.conn), assigns) | |
end | |
defp page_title("index.html", _assigns), do: "Accounts" | |
defp page_title("new.html", _assigns), do: "New Account" | |
defp page_title("edit.html", _assigns), do: "Edit Account" |
This file contains 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
# config/application.rb | |
require_relative 'boot' | |
require 'rails/all' | |
require_relative '../lib/middleware/revision_middleware' | |
# Require the gems listed in Gemfile, including any gems | |
# you've limited to :test, :development, or :production. |
This file contains 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
{ | |
"type": "transaction.created", | |
"data": { | |
"id": "tx_00009TnTFcG7cG6bxxxxxx", | |
"created": "2018-02-19T17:32:03.234Z", | |
"description": "pot_00009Qoyee0RPU0sxxxxxx", | |
"amount": -40000, | |
"fees": {}, | |
"currency": "GBP", | |
"merchant": null, |
This file contains 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 MyApp.Pagination do | |
@moduledoc """ | |
Takes an Ecto query and applies limit and offset style pagination. | |
""" | |
import Ecto.Query | |
defstruct [:entries, :page_number, :page_size, :total_pages] | |
@doc """ |
This file contains 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 MyApp.Factory do | |
use MyApp.Faker, repo: MyApp.Repo | |
def user_factory do | |
%MyApp.Users.User{ | |
name: "Some name", | |
email: "some-name@example.com" | |
} | |
end |
This file contains 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
<canvas id="user-icon" width="256" height="256"></canvas> |