Skip to content

Instantly share code, notes, and snippets.

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.
View GitHub Profile
View gist:61caf03800deb0bb9d5321b3fab36e4a
%{
"artificery": {:hex, :artificery, "0.4.3", "0bc4260f988dcb9dda4b23f9fc3c6c8b99a6220a331534fdf5bf2fd0d4333b02", [:mix], [], "hexpm", "12e95333a30e20884e937abdbefa3e7f5e05609c2ba8cf37b33f000b9ffc0504"},
"bbmustache": {:hex, :bbmustache, "1.11.0", "a6dbfc5cee3e1d7d17aad5f5b8880b4508d974611da8d73e1f6c28bde65d4c47", [:rebar3], [], "hexpm", "7c9cdcf58dc043377ab792a8c7109d8902695fcae3b35c1078a8b38ddcf86e5f"},
"bcrypt_elixir": {:hex, :bcrypt_elixir, "2.2.0", "3df902b81ce7fa8867a2ae30d20a1da6877a2c056bfb116fd0bc8a5f0190cea4", [:make, :mix], [{:comeonin, "~> 5.3", [hex: :comeonin, repo: "hexpm", optional: false]}, {:elixir_make, "~> 0.6", [hex: :elixir_make, repo: "hexpm", optional: false]}], "hexpm", "762be3fcb779f08207531bc6612cca480a338e4b4357abb49f5ce00240a77d1e"},
"bunt": {:hex, :bunt, "0.2.0", "951c6e801e8b1d2cbe58ebbd3e616a869061ddadcc4863d0a2182541acae9a38", [:mix], [], "hexpm", "7af5c7e09fe1d40f76c8e4f9dd2be7cebd83909f31fee7cd0e9eadc567da8353"},
"cachex": {:hex, :cachex, "3.3.0", "6f2ebb8f27491fe3
View gist:598658020d1f72329f797d1f666317bc
defmodule EvercamMedia.Mixfile do
use Mix.Project
def project do
[
app: :evercam_media,
version: "1.0.#{DateTime.to_unix(DateTime.utc_now())}",
elixir: "~> 1.11.1",
elixirc_paths: elixirc_paths(Mix.env()),
build_embedded: Mix.env() == :prod,
@ijunaid8989
ijunaid8989 / pooled_crawler.ex
Created Jul 3, 2020 — forked from Manzanit0/pooled_crawler.ex
Web crawler which uses Floki and HTTPoison – does 5 request at a time
View pooled_crawler.ex
# 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 / lsi.sh
Created Jun 17, 2020 — forked from demofly/lsi.sh
MegaCli wrapper for LSI MegaRAID for Debian/Ubuntu/RHEL/CentOS
View lsi.sh
#!/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.
View maze.rb
class Maze
# Generate a maze.
def generate(width, height)
@width = width
@height = height
@maze = Array.new
for y in 0 ... @height
for x in 0 ... @width
@maze[y * @width + x] = 1
View jsonrepsone
[
{
"id": 1528965627,
"Anger": 0,
"Disgust": 0,
"FaceDetected": 0,
"Fear": 0,
"Happiness": 0,
"LargeFaceDetected": 0,
"MotionDetected": 0,
@ijunaid8989
ijunaid8989 / 0-font-awesome-bootstap-phoenix.md
Created Jan 27, 2018 — forked from mbenatti/0-font-awesome-bootstap-phoenix.md
Installing Bootstrap + Font Awesome from NPM in Phoenix Framework using sass
View 0-font-awesome-bootstap-phoenix.md
  • 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 / colone.sh
Created Jan 16, 2018
cloning db from herokuo
View colone.sh
#!/bin/sh
read -p "This will delete the local database 'evercam_live' and recreate
it from the live database. Are you sure you want to continue? (Y/N): " -n 1 -r
echo # (optional) move to a new line
if [[ ! $REPLY =~ ^[Yy]$ ]]
then
exit 1
fi
# Delete and create local 'evercam_live' database
View printing.rb
# version 1
for counter in 1..100
if (counter % 3 == 0) && (counter % 5 == 0)
puts 'Trakstar'
elsif (counter % 3 == 0)
puts 'Trak'
elsif (counter % 5 == 0)
puts 'Star'
else
View anagram.rb
module Enumerable # or require 'facets/enumerable/frequency'
def frequency
each_with_object(Hash.new(0)) { |item, counter| counter[item] += 1 }
end
end
def anagrams?(s1, s2)
frequency = proc { |s| s.gsub(/\s+/, "").downcase.chars.frequency }
frequency.(s1) == frequency.(s2)
end