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 / postgres_guide.md
Last active May 19, 2023 07:46 — forked from tacionery/postgres_guide
install postgresql on antergos

uninstall postgresql if necessary

sudo pacman -R postgresql postgresql-libs

remove postgres files

sudo rm -rfv /var/lib/postgres
@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)
@blackode
blackode / .iex.exs
Created February 17, 2017 00:52
iex> Customization
# IEx.configure colors: [enabled: true]
# IEx.configure colors: [ eval_result: [ :cyan, :bright ] ]
IO.puts IO.ANSI.red_background() <> IO.ANSI.white() <> " ❄❄❄ Good Luck with Elixir ❄❄❄ " <> IO.ANSI.reset
Application.put_env(:elixir, :ansi_enabled, true)
IEx.configure(
colors: [
eval_result: [:green, :bright] ,
eval_error: [[:red,:bright,"Bug Bug ..!!"]],
eval_info: [:yellow, :bright ],
],

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 / elixir_pocket_syntax.md
Last active December 23, 2021 21:35
Elixir in Pocket

Elixir Pocket Syntax

Uncommon Logical stuff of Elixir modules,definitions and some coding snippets that makes our life easy and fast. We go with very basic to the different approach.

1. Creating Private Functions

Code

@blackode
blackode / execution_time.ex
Created February 11, 2017 18:38
Execution Time for function in elixir
defmodule ExecutionTime do
def time_of(function, args) do
{time, result} = :timer.tc(function, args)
IO.puts "Time: #{time}ms"
IO.puts "Result: #{result}"
end
end
@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)) %>