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
import java.time.LocalDateTime; | |
import java.time.format.DateTimeFormatter; | |
public class DateTimeFormatterExample { | |
public static void main(String []args) { | |
DateTimeFormatter pattern = DateTimeFormatter.ofPattern("yyyy-MM-dd'T'HH:mm:ss.SSS"); | |
LocalDateTime time = LocalDateTime.parse("2018-07-30T18:15:34.823", pattern); | |
System.out.println("parsed time: " + time.toString()); | |
} |
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 HelloPhoenix.HelloController do | |
use HelloPhoenix.Web, :controller | |
def index(conn, _params) do | |
render conn, "index.html" | |
end | |
def show(conn, %{"messenger" => messenger} = params) do | |
HelloPhoenix.Endpoint.subscribe(self(), "potato") | |
receive do |
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
class Device | |
include TempSensors | |
include LightSensors | |
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
defmodule Socket do | |
defstruct socket: nil, transport: nil | |
use GenServer | |
def handle_info({:send, payload}, state=%Socket{socket: socket, transport: transport}) do | |
transport.send(socket, payload) | |
{ :noreply, state } | |
end | |
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
defp deps do | |
[{:ranch, "1.2.0"}, | |
{:uuid, "~>1.1"}, | |
{:json, "~>0.3.0"}, | |
{:cowboy, "1.0.4"}] | |
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
defmodule GenServerTestTest do | |
use ExUnit.Case | |
doctest GenServerTest | |
setup do | |
IO.puts "setup starting" | |
{ :ok, pid } = GenServerTest.start_link() | |
IO.puts "setup started" | |
on_exit fn -> |
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 Foo do | |
def hi do | |
hi_priv(1, 1, 1) | |
end | |
defp hi_priv(a, b, c) when a == b, b == c do | |
IO.puts "hi" | |
end | |
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
diff --git a/lib/blather/client/client.rb b/lib/blather/client/client.rb | |
index 6c7fe4e..9e8350b 100644 | |
--- a/lib/blather/client/client.rb | |
+++ b/lib/blather/client/client.rb | |
@@ -184,11 +184,7 @@ module Blather | |
# @private | |
def receive_data(stanza) | |
- if handler_queue | |
- handler_queue << stanza |
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
"1075553": | |
f1: | |
index: 0 | |
ip: 192.168.107.206 | |
"1075281": | |
f1: | |
index: 1 | |
ip: 192.168.107.206 |
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
(setq ems-netrc (netrc-parse "~/.netrc")) | |
(require 'gist) | |
(setq ems-github-netrc (netrc-machine ems-netrc "github" t)) | |
(setq gist-authenticate-function 'gist-basic-authentication) | |
(setq gist-user-password (netrc-get ems-github-netrc "password")) |
NewerOlder