Skip to content

Instantly share code, notes, and snippets.

View shahryarjb's full-sized avatar
👐
I am ready for a new job offer and relocation

Shahryar Tavakkoli shahryarjb

👐
I am ready for a new job offer and relocation
View GitHub Profile
{
"name": "sidebar-022",
"type": "preset",
"dependencies": [
"blockquote",
"spinner",
"drawer"
],
"files": [
{
-module(connection).
-behaviour(gen_statem).
-export([start_link/1, request/2]).
-export([callback_mode/0, init/1]).
-export([disconnected/3, connected/3]).
%% Public API.
start_link(Opts) ->
@shahryarjb
shahryarjb / json
Created January 30, 2022 05:58 — forked from akoutmos/json
Pretty print JSON passed via STDIN using Elixir shell script
#! /usr/bin/env elixir
# Install required deps
Mix.install([:jason])
# The pretty printing module
defmodule JsonPrettyPrinter do
def get_stdin_data do
# Fetch data from STDIN and decode JSON
:stdio
defmodule BankError.Extera.BankProvider.Zarinpal do
def get_token(type) do
sms_body = Jason.encode!(
%{
"MerchantID" => "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
"Amount" => "1000",
"CallbackURL" => "https://YORSITE.com/back-pay/zarinpal",
"Description" => type
}
// in terminal
"[{\"name\":\"البرز\",\"state_code\":\"31\"},{\"name\":\"تهران\",\"state_code\":\"1\"},{\"name\":\"گيلان\",\"state_code\":\"2\"},{\"name\":\"آذربايجان شرقي\",\"state_code\":\"3\"},{\"name\":\"خوزستان\",\"state_code\":\"4\"},{\"name\":\"فارس\",\"state_code\":\"5\"},{\"name\":\"اصفهان\",\"state_code\":\"6\"},{\"name\":\"خراسان رضوي\",\"state_code\":\"7\"},{\"name\":\"قزوين\",\"state_code\":\"8\"},{\"name\":\"سمنان\",\"state_code\":\"9\"},{\"name\":\"قم\",\"state_code\":\"10\"},{\"name\":\"مركزي\",\"state_code\":\"11\"},{\"name\":\"زنجان\",\"state_code\":\"12\"},{\"name\":\"مازندران\",\"state_code\":\"13\"},{\"name\":\"گلستان\",\"state_code\":\"14\"},{\"name\":\"اردبيل\",\"state_code\":\"15\"},{\"name\":\"آذربايجان غربي\",\"state_code\":\"16\"},{\"name\":\"همدان\",\"state_code\":\"17\"},{\"name\":\"كردستان\",\"state_code\":\"18\"},{\"name\":\"كرمانشاه\",\"state_code\":\"19\"},{\"name\":\"لرستان\",\"state_code\":\"20\"},{\"name\":\"بوشهر\",\"state_code\":\"21\"},{\"name\":\"كرمان\",\"state_code\":\
// We need to import the CSS so that webpack will load it.
// The MiniCssExtractPlugin is used to separate it out into
// its own CSS file.
import css from "../css/app.scss"
import "bootstrap"
// webpack automatically bundles all modules in your
// entry points. Those entry points can be configured
// in "webpack.config.js".
<div class="d-block my-3">
<div class="custom-control custom-radio">
<input id="pishtaz" name="paymentMethod" type="radio" class="custom-control-input" required="">
<label class="custom-control-label shipping-select" for="pishtaz"> <i class="far fa-shipping-fast"></i> پست پیشتاز</label>
</div>
<div class="spacer10"> </div>
<div class="alert alert-info" role="alert">
پست پیشتاز حداکثر به مدت ۳ روز کاری برای شما ارسال می گردد
</div>
<div class="spacer20"> </div>
<div class="alert alert-primary" role="alert">
متن شما
</div>
<div class="alert alert-secondary" role="alert">
متن شما
</div>
<div class="alert alert-success" role="alert">
متن شما
</div>
<div class="alert alert-danger" role="alert">
دکمه های داخل رنکی
<a href="link_shoma" class="btn btn-primary">Primary</a>
<a href="link_shoma" class="btn btn-secondary">Secondary</a>
<a href="link_shoma" class="btn btn-success">Success</a>
<a href="link_shoma" class="btn btn-danger">Danger</a>
<a href="link_shoma" class="btn btn-warning">Warning</a>
<a href="link_shoma" class="btn btn-info">Info</a>
<a href="link_shoma" class="btn btn-light">Light</a>
<a href="link_shoma" class="btn btn-dark">Dark</a>
def test(user_purchases_token, access_token) do
HTTPoison.get("https://pardakht.cafebazaar.ir/devapi/v2/api/applications/com.bankerror/subscriptions/SignUp/purchases/#{user_purchases_token}?access_token=#{access_token}")
end
# back
%HTTPoison.Response{
body: "",
headers: [
{"Date", "Sun, 18 Aug 2019 08:32:59 GMT"},
{"Content-Type", "text/html; charset=utf-8"},