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
from collections import Counter | |
from sklearn.cluster import KMeans | |
from matplotlib import colors | |
import matplotlib.pyplot as plt | |
import numpy as np | |
import cv2 | |
import os | |
def preprocess(raw): | |
image = cv2.resize(raw, (900, 600), interpolation = cv2.INTER_AREA) |
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
{ | |
"openapi": "3.0.0", | |
"info": { | |
"title": "My First API", | |
"version": "0.1" | |
}, | |
"paths": { | |
"/": { | |
"get": { | |
"description": "Home page", |
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
#!/bin/sh | |
# Check This https://regex101.com/r/jkAuu3/1 | |
commit_regex='(((feat|fix|chore|refactor|style|test|docs)(((\w{0,15})))?))(:.\S.*)'; | |
error_msg="Aborting commit. Your commit message format is invalid, please check the references." | |
commit_message="$1"; | |
if ! grep -iqE "$commit_regex" "$commit_message"; | |
then | |
echo "$error_msg" >&2 |
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/env bash | |
LC_ALL=C | |
local_branch="$(git rev-parse --abbrev-ref HEAD)" | |
valid_branch_regex="^(dev|master|(feature|deprecation|bugfix|improvement|library|prerelease|release|hotfix)\/[a-z0-9._-]+$)" | |
message="There is something wrong with your branch name. Branch names in this project must adhere to this contract: $valid_branch_regex. Your commit will be rejected. You should rename your branch to a valid name and try again." | |
if [[ ! $local_branch =~ $valid_branch_regex ]] |
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
from bs4 import BeautifulSoup | |
import requests | |
def main(): | |
_BASE_URL_ = 'https://ipinfo.io/countries/ir' | |
_PAGE_ = requests.get(_BASE_URL_) | |
_SOUP_ = BeautifulSoup(_PAGE_.content, 'html.parser') | |
table_row = _SOUP_.select('table tr') | |
final_dict = [] | |
del table_row[0] |
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
name: Virgool Blog Posts | |
on: | |
schedule: | |
- cron: '0 19 * * *' | |
workflow_dispatch: | |
jobs: | |
update-readme-with-blog: | |
name: Update this repo's README with latest my latest posts |
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
name: Medium Blog Posts | |
on: | |
schedule: | |
- cron: '0 19 * * *' | |
workflow_dispatch: | |
jobs: | |
update-readme-with-blog: | |
name: Update this repo's README with latest my latest posts |
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
{ | |
"guid": "{GUID-TOKEN}", | |
"name": "Windows PowerShell", | |
"commandline": "powershell.exe", | |
"fontFace": "MesloLGS NF", | |
"hidden": false | |
}, |
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
module.exports = (env = {}) => { | |
return { | |
module: { | |
rules: [ | |
...rules, | |
{ | |
loader: 'file-replace-loader', | |
options: { | |
condition: 'always', // <-- Note that the rule applies for all files! | |
replacement(resourcePath) { |
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
const express = require('express'); | |
const mongoose = require('mongoose'); | |
const ShortUrl = require('./models/short-url.js'); | |
const validUrl = require('valid-url'); | |
const app = express(); | |
mongoose.connect('mongodb://localhost/urlShortener', { | |
useNewUrlParser: true, | |
useUnifiedTopology: true, | |
}) |
NewerOlder