Skip to content

Instantly share code, notes, and snippets.

@YuriyGuts
YuriyGuts / russian_casualty_parser.py
Last active September 22, 2023 14:04
Parse the numbers of Russian casualties in Ukraine from a news website, save them to CSV files, and plot them
# -*- coding: utf-8 -*-
# Parse the numbers of Russian casualties in Ukraine from a news website, save them to CSV files, and plot them.
#
# Prerequisites:
# $ pip install beautifulsoup4==4.10.0 matplotlib==3.4.3 requests==2.26.0 pandas==1.3.4
#
# Usage:
# $ python3 russian_casualty_parser.py
#
# Output:
@unbracketed
unbracketed / branch-fu.md
Created April 7, 2015 17:49
Moving commits between branches

Example: Moving up to a few commits to another branch

Branch A has commits (X,Y) that also need to be in Branch B. The cherry-pick operations should be done in the same chronological order that the commits appear in Branch A.

cherry-pick does support a range of commits, but if you have merge commits in that range, it gets really complicated

git checkout branch-B
git cherry-pick X
git cherry-pick Y
@greghelton
greghelton / cookbook.sql
Created January 1, 2012 06:41
MySQL Database for Cookbook, Recipes, Ingredients
-- start the server: $ mysqld --console
-- login: $ mysql -u root --password=wxyz
-- run the script: mysql> source /Users/javapro/dev/src/sql/Cookbook.sql
-- the script:
drop database if exists Cookbook;
create database Cookbook;
connect Cookbook;
@dansimau
dansimau / gist:842415
Created February 24, 2011 16:41
Bash function for running a command, checking the return code, and re-trying it x times after y sleep seconds.
#
# "<cmd>" <retry times> <retry wait>
#
do_retry()
{
cmd="$1"
retry_times=$2
retry_wait=$3
c=0