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
iex([email protected])1> TermuxSmsCli.Fetcher.fetch({TermuxSmsCli.Fetcher, :'[email protected]'}, 1); | |
[ | |
%{ | |
"body" => "You have up to 1GB of VIDEO EVERY DAY with your GIGA subscription. To check your balance and other exciting offers, dial *121# NOW! It's FREE and easy!", | |
"number" => "SMART", | |
"read" => true, | |
"received" => "2019-06-09 01:38", | |
"threadid" => 1, | |
"type" => "inbox" | |
} |
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
def handle_call(:threads, _From, nil) do | |
TermuxSmsCli.Fetcher.fetch(TermuxSmsCli.Fetcher) | |
end | |
def threads(pid) do | |
GenServer.call(pid, :threads) | |
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 TermuxSmsCli.Application do | |
# See https://hexdocs.pm/elixir/Application.html | |
# for more information on OTP Applications | |
@moduledoc false | |
use Application | |
def start(_type, _args) do | |
# List all child processes to be supervised | |
children = if System.get_env("ANDROID_ROOT") do |
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
** (exit) exited in: GenServer.call({TermuxSmsCli.Fetcher, :"[email protected]"}, :threads, 5000) | |
** (EXIT) an exception was raised: | |
** (FunctionClauseError) no function clause matching in TermuxSmsCli.Fetcher.handle_call/3 | |
(termux_sms_cli) lib/termux_sms_cli/fetcher.ex:13: TermuxSmsCli.Fetcher.handle_call(:threads, {#PID<0.173.0>, #Reference<0.507083762.647495681.6201 | |
1>}, nil) | |
(stdlib) gen_server.erl:661: :gen_server.try_handle_call/4 | |
(stdlib) gen_server.erl:690: :gen_server.handle_msg/6 | |
(stdlib) proc_lib.erl:249: :proc_lib.init_p_do_apply/3 | |
(elixir) lib/gen_server.ex:989: GenServer.call/3 |
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
children = if System.get_env("ANDROID_ROOT") do | |
[ TermuxSmsCli.Fetcher, | |
TermuxSmsCli.Thread | |
] else | |
[ TermuxSmsCli.UI | |
] 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
index = Enum.find_index(threads, &(selected == &1)) | |
if index == length threads - 1 do | |
model | |
else | |
Map.replace!(model, :selected, Enum.at(threads, index + 1)) | |
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
case Enum.at(threads, index + 1) do | |
nil -> model | |
selected_ -> Map.replace!(model, :selected, selected_) | |
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
(let ((bootstrap-file (concat user-emacs-directory "straight/repos/straight.el/bootstrap.el")) | |
(bootstrap-version 3)) | |
(unless (file-exists-p bootstrap-file) | |
(with-current-buffer | |
(url-retrieve-synchronously | |
"https://raw.githubusercontent.com/raxod502/straight.el/develop/install.el" | |
'silent 'inhibit-cookies) | |
(goto-char (point-max)) | |
(eval-print-last-sexp))) | |
(load bootstrap-file nil 'nomessage)) |
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
[ 8.596] | |
X.Org X Server 1.20.4 | |
X Protocol Version 11, Revision 0 | |
[ 8.596] Build Operating System: Linux 4.19.17 x86_64 | |
[ 8.596] Current Operating System: Linux myrl 4.19.48 #1-NixOS SMP Tue Jun 4 06:02:35 UTC 2019 x86_64 | |
[ 8.596] Kernel command line: initrd=\efi\nixos\y913a6rdn89lz55za32bjzfb3lb71507-initrd-initrd.efi systemConfig=/nix/store/835wsx0x5hb32a9gf43kwjg97mgk8ibh-nixos-system-myrl-19.03.git.caacbe9 init=/nix/store/835wsx0x5hb32a9gf43kwjg97mgk8ibh-nixos-system-myrl-19.03.git.caacbe9/init loglevel=4 | |
[ 8.596] Build Date: 26 February 2019 07:29:26PM | |
[ 8.596] | |
[ 8.596] Current version of pixman: 0.36.0 | |
[ 8.596] Before reporting problems, check http://wiki.x.org |
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
struct event | |
event_getevent() | |
{ | |
for (;;) | |
{ | |
errno = 0; | |
int c = getch(); | |
switch (c) |