Skip to content

Instantly share code, notes, and snippets.

View SerhatTeker's full-sized avatar
💻
01110011 01110100

Serhat Teker SerhatTeker

💻
01110011 01110100
View GitHub Profile
@SerhatTeker
SerhatTeker / ve
Created May 10, 2022 16:02
Automate Python Virtual Environment with a Script - https://tech.serhatteker.com/post/2022-04/automate-python-virtualenv
#!/usr/bin/env bash
# -*- coding: utf-8 -*-
# vim: set ft=sh et ts=4 sw=4 sts=4:
# =================================================================================================
#
# Copyright 2022 Serhat Teker <me@serhatteker.com>
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
@SerhatTeker
SerhatTeker / install-python
Last active July 28, 2022 18:32
Install Python (with desired version) on an Ubuntu Host
#!/usr/bin/env bash
# Bash safeties: exit on error, no unset variables, pipelines can't hide errors
set -o errexit
set -o nounset
set -o pipefail
# INFO
# --------------------------------------------------------------------------------------
# A shell script that downloads and installs Python on an Ubuntu host
@SerhatTeker
SerhatTeker / cloudSettings
Last active May 20, 2022 21:50
Visual Studio Code Settings Sync Gist
{"lastUpload":"2022-05-20T21:49:53.702Z","extensionVersion":"v3.4.3"}
@SerhatTeker
SerhatTeker / theme.yml
Created March 4, 2022 11:51 — forked from r-darwish/theme.yml
Alacritty One Dark Theme
colors:
# Default colors
primary:
background: '0x1e2127'
foreground: '0xabb2bf'
# Bright and dim foreground colors
#
# The dimmed foreground color is calculated automatically if it is not present.
@SerhatTeker
SerhatTeker / clean-ubuntu
Last active February 18, 2022 19:21 — forked from Iman/clean.sh
Free up disk space on Ubuntu - clean log, cache, archive packages/apt archives, orphaned packages, old kernel and remove the trash
#!/usr/bin/env bash
# -*- coding: utf-8 -*-
# vim: set ft=sh et ts=4 sw=4 sts=4:
# INFO
# --------------------------------------------------------------------------------------
# Free up disk space on Debian, Ubuntu - clean log, cache, archive packages/apt archives,
# orphaned packages, old kernel and remove the trash
#
# Gist repo:
@SerhatTeker
SerhatTeker / uffizi.md
Last active July 23, 2020 15:31
Uffizi

Uffizi

@SerhatTeker
SerhatTeker / .functions
Last active May 12, 2020 14:21
Start a Workspace in a Tmux Session for a Project
# If a virtualenv with name of .venv, load it.
auto-venv() {
if [ -z "$VIRTUAL_ENV" ]; then
if [ -d .venv/ ]; then
source .venv/bin/activate
fi
fi
}
@SerhatTeker
SerhatTeker / .editorconfig
Last active March 31, 2020 13:46
Hugo git initial template #hugo #go #cms
# http://editorconfig.org
root = true
[*]
charset = utf-8
end_of_line = lf
insert_final_newline = true
trim_trailing_whitespace = true
@SerhatTeker
SerhatTeker / README-Template.md
Created March 11, 2020 12:50 — forked from PurpleBooth/README-Template.md
A template to make good README.md

Project Title

One Paragraph of project description goes here

Getting Started

These instructions will get you a copy of the project up and running on your local machine for development and testing purposes. See deployment for notes on how to deploy the project on a live system.

Prerequisites

@SerhatTeker
SerhatTeker / word_count.py
Last active February 27, 2020 18:29
Word Count Regex - Python
import re
import collections
def count_words(sentence):
word_list = re.findall(r"[\da-zA-Z]+(?:\'[\da-zA-Z]+)?", sentence.lower())
return collections.Counter(word_list)
# Alternative