Skip to content

Instantly share code, notes, and snippets.

View ijunaid8989's full-sized avatar
🇵🇰
It may have escaped your notice but life isn't fair.

Junaid Farooq ijunaid8989

🇵🇰
It may have escaped your notice but life isn't fair.
  • Islamabad Pakistan
View GitHub Profile
@ijunaid8989
ijunaid8989 / capybara cheat sheet
Last active September 17, 2015 06:54 — forked from zhengjia/capybara cheat sheet
capybara cheat sheet
=Navigating=
visit('/projects')
visit(post_comments_path(post))
=Clicking links and buttons=
click_link('id-of-link')
click_link('Link Text')
click_button('Save')
click('Link Text') # Click either a link or a button
click('Button Value')
@ijunaid8989
ijunaid8989 / 0-font-awesome-bootstap-phoenix.md
Created January 27, 2018 13:43 — forked from mbenatti/0-font-awesome-bootstap-phoenix.md
Installing Bootstrap + Font Awesome from NPM in Phoenix Framework using sass
  • Tested with Phoenix 1.3

1) Installing sass, font-awesome and bootstrap package's

First, install the Sass, Font Awesome, bootstrap(and deps) package:

cd assets

  • npm install --save-dev sass-brunch
  • npm install --save font-awesome
@ijunaid8989
ijunaid8989 / lsi.sh
Created June 17, 2020 04:58 — forked from demofly/lsi.sh
MegaCli wrapper for LSI MegaRAID for Debian/Ubuntu/RHEL/CentOS
#!/bin/bash
#
# originally came from Calomel.org
# https://calomel.org/megacli_lsi_commands.html
# LSI MegaRaid CLI
# lsi.sh @ Version 0.05
# Edited and optimized by demofly for rotational RAID arrays
#
# description: MegaCLI script to configure an Sound alarm disabled (server room too loud anyways)d monitor LSI raid cards.
@ijunaid8989
ijunaid8989 / pooled_crawler.ex
Created July 3, 2020 13:22 — forked from Manzanit0/pooled_crawler.ex
Web crawler which uses Floki and HTTPoison – does 5 request at a time
# Dependencies:
# {:httpoison, "~> 1.5"},
# {:floki, "~> 0.21.0"}
# {:benchee, "~> 1.0"} (Only for benchmarking – not in the script)
defmodule CrawlQueue do
use Agent
def start_link(urls) do
@ijunaid8989
ijunaid8989 / extract_tar_from_binary.ex
Created September 12, 2022 12:41 — forked from nroi/extract_tar_from_binary.ex
Decompressing a tar.gz archive in Elixir with Erlang's :erl_tar module.
@doc"""
Returns a map containing all files and their contents from the compressed tar archive.
"""
def extract_tar_from_binary(binary) do
with {:ok, files} <- :erl_tar.extract({:binary, binary}, [:memory, :compressed]) do
files
|> Enum.map(fn {filename, content} -> {to_string(filename), content} end)
|> Map.new
end
end
@ijunaid8989
ijunaid8989 / Howto.md
Created February 1, 2024 20:40 — forked from jeregrine/Howto.md
Setting up Redo and Poolboy for redis connections in Elixir

Then add

worker(Redis, []),

to your supervision tree