Skip to content

Instantly share code, notes, and snippets.

View daleathan's full-sized avatar
🏠
Working from home

Dale Athanasias daleathan

🏠
Working from home
View GitHub Profile
@andsens
andsens / merge-repo-to-subdir.sh
Created July 15, 2017 19:28
Merges a repo into a subdirectory of another repo (useful when making a submodule part of a parent repo)
#!/bin/bash -e
function merge_repo_to_subdir {
local url=$1
local commit=$2
local module_path=$3
if [[ -z $url || -z $commit || -z $module_path ]]; then
echo "Usage: merge-repo-to-subdir.sh URL BRANCH PATH" >&2
exit 1
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
MIT License
Copyright (c) 2016 Matt Menzenski
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
@regebro
regebro / requirements.py
Last active August 29, 2015 14:02
Prints the requirements of the current working set of packages. Requires setuptools.
# -*- coding:utf-8 -*-
import pkg_resources
projects = set()
def print_requirements(distribution, lvl=-1):
lvl += 1
dname = distribution.project_name.lower()
if dname in projects:
return
# -*- coding:utf-8 -*-
import pkg_resources
from collections import defaultdict
def add_rdependencies(d, result):
for r in d.requires():
result[r.project_name.lower()].add(d)
@thomasfr
thomasfr / Git push deployment in 7 easy steps.md
Last active October 5, 2025 07:57
7 easy steps to automated git push deployments. With small and configurable bash only post-receive hook
@lyoshenka
lyoshenka / search-git-history.md
Last active September 27, 2025 02:50
Search Git commit history for a string and see the diffs

Searching Git commit history

This should be one of the core features of Git, but for some reason it's impossible to figure out how to search for a string in your commit history and see the diffs that that string is in. Here's the best I've come up with:

To find which commits and which files a string was added or removed in:

git log -S'search string' --oneline --name-status

To see the diff of that

@kaydell
kaydell / python3_gui_template.py
Created October 9, 2013 15:23
Python 3 GUI Starting Point
#!/usr/bin/env python3
def main():
# require Python 3
import sys
if sys.version_info.major < 3:
print("This program requires Python 3 or later")
return
@livibetter
livibetter / README.md
Last active February 12, 2020 20:48
Tkinter (Tk/Ttk) Progressbar widget example
@rhoit
rhoit / tkinter py2→py3
Last active December 18, 2015 20:39
tkinter py2→py3
py2 → py3
Tkinter → tkinter
tkMessageBox → tkinter.messagebox
tkColorChooser → tkinter.colorchooser
tkFileDialog → tkinter.filedialog
tkCommonDialog → tkinter.commondialog
tkSimpleDialog → tkinter.simpledialog
tkFont → tkinter.font
Tkdnd → tkinter.dnd
ScrolledText → tkinter.scrolledtext
@MrValdez
MrValdez / time_machine.py
Created December 14, 2012 08:21
This is a time machine. This works on Python 2.x and 3.x (tested on 2.5 and 3.2, respectively). What I am proud of: * no classes * very simple code of a time machine running on Tkinter. * does exactly as it says on the tin
try:
import Tkinter as tkinter
import tkFont
except ImportError:
# python 3
import tkinter
import tkinter.font as tkFont
import time