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 / 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 / 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 / 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 / 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
@SerhatTeker
SerhatTeker / gist:42f6d3807cf17d0b7221886648b6b267
Created January 24, 2020 13:50 — forked from abhishekkr/gist:4165864
shell.func-download-all-files-from-any-GITHUB-GIST-URL {updated to *new* gist}
# Usage Example: $ ddl-gist 'https://gist.github.com/4137843' ~/Downloads/gists
# save the gist files at that URL in ~/Downloads/gists
##
ddl_gist(){
if [ $# -ne 2 ];
then
echo 'Failed. Syntax: $> ddl-gist GITHUB_GIST_URL DOWNLOAD_PATH'
return
fi
@SerhatTeker
SerhatTeker / backup-gist.py
Last active January 24, 2020 13:21
Clone or update a user's gists locally
#!/usr/bin/env python3
# Clone or update all a user's gists
# curl -ks https://gist.githubusercontent.com/SerhatTeker/3b9bd9c5add01730f67ee5458db13b2e/raw/a4de62633a8818580d37114b20efbd576388413d/backup-gist.sh | bash
# curl -ks https://gist.githubusercontent.com/SerhatTeker/3b9bd9c5add01730f67ee5458db13b2e/raw/a4de62633a8818580d37114b20efbd576388413d/backup-gist.sh | USER=serhatteker bash
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals