Skip to content

Instantly share code, notes, and snippets.

View blackode's full-sized avatar
:octocat:
Pushed code so fast, even my coffee is still loading. ☕💻 #CodingFuel

Ankanna blackode

:octocat:
Pushed code so fast, even my coffee is still loading. ☕💻 #CodingFuel
View GitHub Profile
@blackode
blackode / install_erlang.sh
Created April 28, 2023 03:03
Erlang older versions Installation process
#!/bin/sh
git clone https://github.com/openssl/openssl.git --branch OpenSSL_1_0_2-stable
cd openssl
./config --prefix=$HOME/.openssl-1.0 shared -fPIC
make depend && make && make install
mkdir -p $HOME/.openssl-1.0
cd $HOME/.openssl-1.0
ln -sf /usr/lib/openssl-1.0 lib
ln -sf /usr/include/openssl-1.0 include
@blackode
blackode / debugger.ex
Last active August 6, 2022 17:16
Debugger Information
defmodule Salt.Debugger do
@moduledoc false
def debugger(code, _options, caller, device) do
quote do
# calculating the result
result = unquote(code)
module = unquote(caller.module)
{fun_name, arity} = unquote(caller.function)
line_number = unquote(caller.line)
file = unquote(caller.file)

Keybase proof

I hereby claim:

  • I am blackode on github.
  • I am blackode (https://keybase.io/blackode) on keybase.
  • I have a public key ASCSPchSnkVFyAfwvCNc_kZ06XLnCAkfn-FNoCwBRaQ1JAo

To claim this, I am signing this object:

@blackode
blackode / max_processes.ex
Last active December 9, 2020 19:46
Maximum Processes Limit
for _ <- 0..1_000_000 do
p_count = Process.list() |> Enum.count()
IO.puts "Creating Process: #{p_count}"
spawn(Process, :sleep, [:infinity])
rescue
end
@blackode
blackode / linechart.html.eex
Created October 3, 2020 19:31
A template to render the linecharr.js with dynamic data
<hr>
<h2> The Line Graph on Revenues & Years </h2>
<hr>
<div>
<canvas id="lineChart" width="100%" height="100%"></canvas>
</div>
<script type="text/javascript">
window.chart_data = <%= raw(Jason.encode!(fetch_chart_data @revenues)) %>
@blackode
blackode / .iex.exs
Created April 6, 2020 18:48
Main iex configuration file
# Creator: blackode
# email: mrblackode@gmail.com
# Load another ".iex.exs" file
# import_file("~/.custom_iex.exs")
# Import ecto quries for testing quries in iex
import_if_available(Ecto.Query)
# IEx.configure colors: [enabled: true]
# IEx.configure colors: [ eval_result: [ :cyan, :bright ] ]
@blackode
blackode / inspect_iex.exs
Created April 6, 2020 18:31
IO.inspect default options list
IEx.configure(
inspect: [
limit: :infinity,
charlists: :as_lists,
pretty: true,
binaries: :as_strings,
printable_limit: :infinity
]
)
@blackode
blackode / colors_iex.exs
Created April 6, 2020 18:28
Syntax and DataTypes color configuration
IEx.configure(
colors: [
syntax_colors: [
number: :magenta,
atom: :cyan,
string: :green,
boolean: :magenta,
nil: :red
],
@blackode
blackode / prompt_iex.exs
Created April 6, 2020 18:14
IEx default and continuation prompt
IEx.configure(
# This will display when we enter multi lines of code. I used 4 empty spaces.
# If you need you can update it with the unicode symbols you like
continuation_prompt: " ",
default_prompt:
[
# ANSI CHA, move cursor to column 1
"\e[G",
# This is default prefix like iex