Skip to content

Instantly share code, notes, and snippets.

@Sacristan
Sacristan / push_commits_by_chunks.sh
Last active May 22, 2025 03:51
Push commits by chunks
REMOTE=origin
BRANCH=$(git rev-parse --abbrev-ref HEAD)
BATCH_SIZE=10
# check if the branch exists on the remote
# if git show-ref --quiet --verify refs/remotes/$REMOTE/$BRANCH; then
# # if so, only push the commits that are not on the remote already
# range=$REMOTE/$BRANCH..HEAD
# else
# # else push all the commits
@guillaumevincent
guillaumevincent / README.md
Last active December 9, 2024 14:37
Windows Service with Python 3.5 and pyinstaller
@Zulko
Zulko / cubes_pyode_vapory.py
Last active February 16, 2025 12:05
3D cubes animation with PyODE and Vapory
"""
Physics simulation with PyODE followed by a (basic) rendering with Vapory
See the result here: http://i.imgur.com/TdhxwGz.gifv
Zulko 2014
This script is placed in the Public Domain (Licence Creative Commons 0)
"""
@trajakovic
trajakovic / openssl_split_one_pem_to_multiple.sh
Created October 23, 2013 11:36
Split SSL PEM multiple certificates into files
wget -O - http://curl.haxx.se/ca/cacert.pem | awk 'split_after==1{n++;split_after=0} /-----END CERTIFICATE-----/ {split_after=1} {print > "cert" n ".pem"}'
import itertools
def lowpass(img):
"""
A simple pure python low pass (antialiasing) filter.
Applies a gaussian blur on a 2D list of floats.
"""
width = len(img[0])
height = len(img)
@ecorson
ecorson / drush_admin_create
Created April 3, 2012 14:43
Add admin user via Drush
drush user-create adminuser --mail="[email protected]" --password="UserPw"; drush user-add-role "administrator" adminuser