Skip to content

Instantly share code, notes, and snippets.

Avatar

Hugo van Kemenade hugovk

  • Nord Software
  • Helsinki, Finland
  • @hugovk
View GitHub Profile
@aaltat
aaltat / py_finder.py
Last active Mar 2, 2020
Find files which are not Python 3 compatible
View py_finder.py
import argparse
import subprocess
from pathlib import Path
def find_files(src_root: Path, python3: Path):
not_py3_compatible = []
for file in src_root.rglob('*.py'):
print(file.resolve())
@tirkarthi
tirkarthi / py3_issues.md
Last active Feb 18, 2020
Python 3.8 and 3.9 issues
View py3_issues.md

Do take one issue per person to help others :) Also checkout Fedora tracker for more easy issues : https://bugzilla.redhat.com/show_bug.cgi?id=1785415 . I tried to mark the issues complete but it's more maintenance so sorry if the issue is fixed or already has a PR and is not updated here.

@sloria
sloria / dropping_py2.md
Last active Feb 13, 2020
Checklist for dropping Python 2 in my libraries
View dropping_py2.md
  • Add pyupgrade to .pre-commit-config.yaml.

If supporting py35, use --py3-plus instead of --py36-plus.

- repo: https://github.com/asottile/pyupgrade
  rev: ...latest version...
  hooks:
  - id: pyupgrade
    args: [--py36-plus]
@nnja
nnja / .pdbrc
Created Aug 2, 2019
My .pdbrc file with an interacti alias
View .pdbrc
# Install IPython: python3 -m pip install ipython
import IPython
from traitlets.config import get_config
cfg = get_config()
cfg.InteractiveShellEmbed.colors = "Linux" # syntax highlighting
cfg.InteractiveShellEmbed.confirm_exit = False
alias interacti IPython.embed(config=cfg)
@mieky
mieky / macos-lifehacks.md
Last active Oct 27, 2020
MacOS Lifehacks
View macos-lifehacks.md

Collection of useful tips & tricks to set up on a Mac.

Safari: bind cmd+alt+arrows to switch between previous/next tab

defaults write -app Safari NSUserKeyEquivalents '{
"Show Next Tab" = "@~\\U2192";
"Show Previous Tab" = "@~\\U2190";
}'
@mortenson
mortenson / metatag_example.php
Created Feb 26, 2019
OR statements in metatags...
View metatag_example.php
<?php
/**
* Implements hook_metatags_attachments_alter().
*
* This function allows you to define fallback tokens in case a field is empty.
*
* If all fallback values are empty, the tag will be empty.
*
* Example: [node:field_image:medium]||[node:field_legacy_image:medium]||/fallback.png
@joyrexus
joyrexus / README.md
Last active Jan 15, 2021
collapsible markdown
View README.md

collapsible markdown?

CLICK ME

yes, even hidden code blocks!

print("hello world!")
@zerolab
zerolab / d8_my_advanced_tab.php
Created Nov 3, 2016
Drupal 8 move something to the advanced tabs on node forms
View d8_my_advanced_tab.php
<?php
/**
* Implements hook_form_FORM_ID_alter().
*
* Move your field or group of fields to the node form options vertical tabs.
*/
function mymodule_form_node_form_alter(&$form, FormState $form_state, $form_id) {
$form['mygroup'] = [
View .travis.yml
# Supercharge your Travis builds with yarn
# Commit your lock file locally, and change your travis to this
language: node_js
node_js:
- "4"
install:
- npm -g install yarn
- yarn
cache:
directories:
@juanpabloaj
juanpabloaj / README.md
Last active Jun 18, 2018
Total of pip packages downloaded, separated by Python versions
View README.md

Total of pip packages downloaded separated by Python versions

From June 26, 2016 (python 3.5.2 release) to Aug. 31, 2016.

Python versions from 2.6 to 3.5

downloads_by_versions

Without 2.7

You can’t perform that action at this time.