Skip to content

Instantly share code, notes, and snippets.

View Zverik's full-sized avatar

Ilya Zverev Zverik

View GitHub Profile
@nanos
nanos / 1 - Mastodon Comments.md
Last active February 19, 2025 20:59
Mastodon Comments

Mastodon Comments

A simple, dependency-free script to add Mastodon-powered comments to your site. For details see Adding comments to your blog, powered by mastodon

Turn this HTML

<div id="comments"></div>
<script>
 addEventListener('DOMContentLoaded', (event) =&gt; window.loadComments('{mastodon}',document.getElementById('comments')));
@fomightez
fomightez / useful_notebook_snippets
Last active June 19, 2025 16:08
Useful snippets for Jupyter notebooks
# Use `%%capture` to hush 'noisy' stdout and stderr streams, but still combine with getting `%%time` after
%%capture out_stream
%%time
---rest of a cell that does something with LOTS of output--
#In cell after, put following to get time of completion from that:
#time it took to run cell above
for x in out_stream.stdout.split("\n")[-3:]:
print(x)
@technion
technion / Password References.md
Last active June 11, 2025 12:07
A set of references on modern password policies

References on modern password policies

Below links provide source, reference link and relevant quote

Standards

NIST

https://github.com/usnistgov/800-63-3/blob/nist-pages/sp800-63b/sec5_authenticators.md

Verifiers SHOULD NOT impose other composition rules (e.g., requiring mixtures of different character types or prohibiting consecutively repeated characters) for memorized secrets. Verifiers SHOULD NOT require memorized secrets to be changed arbitrarily (e.g., periodically).However, verifiers SHALL force a change if there is evidence of compromise of the authenticator.

Major organisations

@jgornick
jgornick / ansible.yml
Created May 19, 2015 12:49
Ansible: Remove All Files Except
---
- name: Capture files in path and register
shell: >
ls -1 /path/to/files
register: files
- name: Remove files except specified
file:
path: "/path/to/files/{{ item }}"
state: absent
@lonvia
lonvia / gist:f24516f8672a0fad2740
Created May 8, 2014 15:24
Creating regional OSM .osc diffs
#!/bin/bash
cd /tmp
SCRIPTDIR=/etc/planet/hourly.d
BASEDIR=/srv/planet.osm.ch
DATADIR=$BASEDIR/data
WWWDIR=$BASEDIR/site
LOCKFILE=$DATADIR/chextract.lock
BBOX="5,45.3,11.3,48.3"

Description

This simple script will take a picture of a whiteboard and use parts of the ImageMagick library with sane defaults to clean it up tremendously.

The script is here:

#!/bin/bash
convert $1 -morphology Convolve DoG:15,100,0 -negate -normalize -blur 0x1 -channel RBG -level 60%,91%,0.1 $2

Results

@crccheck
crccheck / README.md
Last active May 19, 2025 20:42
Python Packaging

What the Hell? -- A Journey Through the Nine Circles of Python Packing

Writing a setup.py

map

I am no Virgil, but having stumbled my way through Python packaging a few times already, I'm documenting the things I learn as I go here.

To help me learn, I took a survey of the top 15 Python packages on Github along with 12 other commonly referenced packages. I thought... if there are any best

@sgmurphy
sgmurphy / url_slug.php
Created July 12, 2012 15:52
URL Slugs in PHP (with UTF-8 and Transliteration Support)
<?php
/**
* Create a web friendly URL slug from a string.
*
* Although supported, transliteration is discouraged because
* 1) most web browsers support UTF-8 characters in URLs
* 2) transliteration causes a loss of information
*
* @author Sean Murphy <[email protected]>
* @copyright Copyright 2012 Sean Murphy. All rights reserved.
@marktheunissen
marktheunissen / pedantically_commented_playbook.yml
Last active June 15, 2025 15:49 — forked from phred/pedantically_commented_playbook.yml
Insanely complete Ansible playbook, showing off all the options
This playbook has been removed as it is now very outdated.