$ docker
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
Javascript: Immutable way of changing quantity in a shopping cart | |
*/ | |
let cart = [{ | |
id: 1, | |
quantity: 3 | |
}, | |
{ | |
id: 2, | |
quantity: 4 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import hashlib | |
def check_md5(filename, block_size = 128): | |
f = open(filename, 'rb') | |
md5 = hashlib.md5() | |
while True: | |
data = f.read(block_size) | |
if not data:break | |
md5.update(data) | |
f.close() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Smooth Scrolling in Web pages - provides smooth scrolling when local anchor tag is clicked | |
// Source: http://www.catswhocode.com/blog/useful-jquery-code-snippets | |
// HTML: | |
// <h1 id="anchor">Lorem Ipsum</h1> | |
// <p><a href="#anchor" class="topLink">Back to Top</a></p> | |
$(document).ready(function() { | |
$("a.topLink").click(function() { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/bash | |
## | |
## Creates Service file based on JSON data | |
## | |
# Sample JSON file: | |
# { | |
# "service_name": "test_service", | |
# "description": "Netcore dev server", |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" | |
Create systemd service file in Linux from given JSON data file | |
Author: Ahmed Sadman Muhib | |
""" | |
""" | |
Sample JSON file: | |
{ | |
"service_name": "test_service", |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" | |
Description : Simple Python implementation of the Apriori Algorithm | |
Usage: | |
$python apriori.py -f DATASET.csv -s minSupport -c minConfidence | |
$python apriori.py -f DATASET.csv -s 0.15 -c 0.6 | |
Original Author: github.com/asaini | |
Modifications: github.com/ahmedsadman (Converted to Python 3 and output fixes) | |
Example Dataset: https://github.com/asaini/Apriori/blob/master/INTEGRATED-DATASET.csv |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import sys | |
import requests | |
import calendar | |
import json | |
from datetime import datetime | |
from pprint import pprint | |
class ApiTester: | |
def __init__(self, api_key): |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
version: '3.6' | |
volumes: | |
database: | |
services: | |
api: | |
build: . | |
depends_on: | |
- mysqldb |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# pull official base image | |
FROM python:3.8.2 | |
# set work directory | |
WORKDIR /app | |
RUN pip install --upgrade pip | |
# required for some package builds | |
RUN apt-get install libssl-dev libffi-dev |
OlderNewer