Skip to content

Instantly share code, notes, and snippets.

View armohamm's full-sized avatar

Abdul Rahiman armohamm

  • Bengaluru, India
View GitHub Profile
@armohamm
armohamm / shotgunThreadSafeTest.py
Created February 7, 2022 15:37 — forked from danielskovli/shotgunThreadSafeTest.py
Simple demo of a thread-safe implementation of Shotgun Python API via pool storage and a pool (context) manager
# -*- coding: utf-8 -*-
'''
Shotgun thread-safe API call demo for Python 3.x
Requires Shotgun Python API: https://github.com/shotgunsoftware/python-api
Context manager implementation based on concept from ArjanCodes: https://www.youtube.com/watch?v=Rm4JP7JfsKY
All code provided as a single file for ease of testing/demo. Should most definitely be split into
@armohamm
armohamm / ror-provisioning.sh
Created September 30, 2020 00:14 — forked from arielcr/ror-provisioning.sh
Ruby on Rails Provisioning Script
#!/bin/bash
echo Provisioning Ruby on Rails...
echo =================================
echo - Installing dependencies
sudo apt-get update -y -qq > /dev/null
sudo apt-get install curl -y -qq > /dev/null
echo - Installing mysql server
export DEBIAN_FRONTEND=noninteractive
@armohamm
armohamm / leaky.py
Created September 24, 2020 00:25 — forked from waichee/leaky.py
import time
import random
# A dummy script which keeps increasing the number of string added to list a
thing = "hi"
a = []
for i in range(1000):
a.append(thing * random.randint(1000,2000))
time.sleep(0.1)
@armohamm
armohamm / gist:38f94e75adc1594551ac80cc53591f86
Created February 18, 2020 19:37 — forked from telent/gist:9742059
12 factor app configuration vs leaking environment variables
App configuration in environment variables: for and against
For (some of these as per the 12 factor principles)
1) they are are easy to change between deploys without changing any code
2) unlike config files, there is little chance of them being checked
into the code repo accidentally
3) unlike custom config files, or other config mechanisms such as Java
internal interface IExampleService
{
Task VeryImportantWorkAsync(int additionalSecondsToWait);
}
internal sealed class ExampleService : IExampleService
{
private readonly IImportantDataProvider _dataProvider;
public ExampleService(IImportantDataProvider dataProvider)
@armohamm
armohamm / pipenv_cheat_sheet.md
Created February 11, 2020 20:07 — forked from DanielHemmati/pipenv_cheat_sheet.md
Pipenv cheat sheet for common commands

Pipenv Cheat Sheet

Install pipenv

pip3 install pipenv

Activate

pipenv shell
@armohamm
armohamm / install_LEMP.sh
Created February 11, 2020 20:06 — forked from GShwartz/install_LEMP.sh
Auto basic LEMP installation script for Ubuntu 18.04 (nginx, MySql, PHP7.3)
#!/bin/bash
######################################################
# AUTO LEMP INSTALLATION #
# Written by Gil Shwartz #
# gilshwartzdjgs@gmail.com #
######################################################
clear
echo "#######################################################"
if (( $EUID != 0 )); then
echo
@armohamm
armohamm / getSunday.php
Created February 11, 2020 20:05 — forked from thewhistler1/getSunday.php
Get nearest Sunday's date from date
function getSunday($date) {
$dow = strftime("%A", strtotime($date));
switch ($dow) {
case "Monday";
$date = date ('Y-m-d', strtotime ("$date - 1 days"));
return $date;
case "Tuesday";
$date = date ('Y-m-d', strtotime ("$date - 2 days"));
return $date;
case "Wednesday";
@armohamm
armohamm / install_LAMP.sh
Created February 11, 2020 20:03 — forked from GShwartz/install_LAMP.sh
Auto basic LAMP installation for Ubuntu 18.04 (Apache2, MySql, PHP7.3)
#!/bin/bash
######################################################
# AUTO LAMP INSTALLATION #
# Written by Gil Shwartz #
# gilshwartzdjgs@gmail.com #
######################################################
clear
echo "#######################################################"
if (( $EUID != 0 )); then
echo "[!] This script requires root privileges in order"
@armohamm
armohamm / VPC Cloudformation.yml
Created February 11, 2020 20:00 — forked from DavidJFelix/VPC Cloudformation.yml
How I setup my VPC
AWSTemplateFormatVersion: '2010-09-09'
Metadata:
License: Apache-2.0
Parameters:
CidrBlocks:
Description: FIXME Remove. The CIDR blocks to use for the subnets in the services VPC.
Default: '10.0.0.0/24,10.0.1.0/24,10.0.2.0/24,10.0.3.0/24,10.0.4.0/24,10.0.5.0/24'
Type: CommaDelimitedList