Skip to content

Instantly share code, notes, and snippets.

View acangiani's full-sized avatar
😀

Agustín Cangiani acangiani

😀
  • Buenos Aires, Argentina
View GitHub Profile
@eyeseast
eyeseast / python.md
Last active November 6, 2023 01:32
How to set up Python in 2022

I have an updated version of this on my blog here: https://chrisamico.com/blog/2023-01-14/python-setup/.

Python

This is my recommended Python setup, as of Fall 2022. The Python landscape can be a confusing mess of overlapping tools that sometimes don't work well together. This is an effort to standardize our approach and environments.

Tools and helpful links:

  • Python docs: https://docs.python.org/3/
  • Python Standard Library:  - Start here when you're trying to solve a specific problem
[core]
editor = vim
[alias]
hist = log --pretty=format:\"%C(yellow)%h%Creset %C(cyan)%ad%Creset %s [%Cgreen%an%Creset]\" --graph --date=short
@Cryptophobia
Cryptophobia / changelog-v2.21.0.md
Created May 6, 2019 00:34
Hephy Workflow v2.21.0 Changelog

Releases

  • router v2.15.1 -> v2.16.0
  • slugbuilder v2.7.0 -> v2.7.1
  • workflow v2.20.2 -> v2.21.0
  • workflow-cli v2.20.2 -> v2.21.0
  • workflow-e2e v2.20.2 -> v2.21.0

Features

@peregrinogris
peregrinogris / main-tuples.rs
Last active July 19, 2018 19:54
Twelve Days of Christmas implementation in Rust.
fn main() {
let gifts = [
("First", "a Partridge in a Pear Tree"),
("Second", "Two Turtle Doves"),
("Third", "Three French Hens"),
("Fourth", "Four Calling Birds"),
("Fifth", "Five Gold Rings"),
("Sixth", "Six Geese a-Laying"),
("Seventh", "Seven Swans a-Swimming"),
("Eighth", "Eight Maids a-Milking"),
@zaydek-old
zaydek-old / bookmark.min.js
Last active January 22, 2023 13:42
A *simple* CSS debugger. To use, bookmark "Debug CSS" at https://zaydek.github.io/debug.css. Learn more here https://medium.freecodecamp.org/88529aa5a6a3 and https://youtu.be/2QdzahteCCs?t=1m25s (starts at 1:25)
/* debug.css | MIT License | zaydek.github.com/debug.css */ if (!("is_debugging" in window)) { is_debugging = false; var debug_el = document.createElement("style"); debug_el.append(document.createTextNode(`*:not(g):not(path) { color: hsla(210, 100%, 100%, 0.9) !important; background: hsla(210, 100%, 50%, 0.5) !important; outline: solid 0.25rem hsla(210, 100%, 100%, 0.5) !important; box-shadow: none !important; filter: none !important; }`)); } function enable_debugger() { if (!is_debugging) { document.head.appendChild(debug_el); is_debugging = true; } } function disable_debugger() { if (is_debugging) { document.head.removeChild(debug_el); is_debugging = false; } } !is_debugging ? enable_debugger() : disable_debugger();
@tomwwright
tomwwright / gist:f88e2ddb344cf99f299935e1312da880
Last active November 22, 2022 14:06
Dell XPS 15 9560: Ubuntu 17.10 + Nvidia 384.90 + Nvidia Prime (No Bumblebee) https://medium.com/@tomwwright/better-battery-life-on-ubuntu-17-10-4588b7f72def
# perform a fresh install of Ubuntu 17.10
# upgrade the kernel to v4.13.10
mkdir ~/kernel-v4.13.10
cd ~/kernel-v4.13.10
wget http://kernel.ubuntu.com/~kernel-ppa/mainline/v4.13.10/linux-headers-4.13.10-041310_4.13.10-041310.201710270531_all.deb
wget http://kernel.ubuntu.com/~kernel-ppa/mainline/v4.13.10/linux-headers-4.13.10-041310-generic_4.13.10-041310.201710270531_amd64.deb
wget http://kernel.ubuntu.com/~kernel-ppa/mainline/v4.13.10/linux-image-4.13.10-041310-generic_4.13.10-041310.201710270531_amd64.deb
sudo dpkg -i *.deb
@alekseykulikov
alekseykulikov / index.md
Last active April 14, 2024 00:32
Principles we use to write CSS for modern browsers

Recently CSS has got a lot of negativity. But I would like to defend it and show, that with good naming convention CSS works pretty well.

My 3 developers team has just developed React.js application with 7668 lines of CSS (and just 2 !important). During one year of development we had 0 issues with CSS. No refactoring typos, no style leaks, no performance problems, possibly, it is the most stable part of our application.

Here are main principles we use to write CSS for modern (IE11+) browsers:

@peregrinogris
peregrinogris / max_search.py
Created June 27, 2016 17:49
Search for the maximum valid number in a range. Useful for scanning sequential ids and quickly (O(log(max_value))) find the maximum valid id.
class MaxSearch:
def __init__(self, max_value=2**16):
self.max_value = max_value
# Override this method with your validity check
def check_result(self, number):
pass
def scan(self, min_=0):
max_ = self.max_value
@kn9ts
kn9ts / GPLv3.md
Last active March 8, 2024 07:26
GPLv3 explained

GPL3 LICENSE SYNOPSIS

TL;DR* Here's what the license entails:

1. Anyone can copy, modify and distribute this software.
2. You have to include the license and copyright notice with each and every distribution.
3. You can use this software privately.
4. You can use this software for commercial purposes.
5. If you dare build your business solely from this code, you risk open-sourcing the whole code base.
@kylefox
kylefox / post_compile.sh
Last active October 23, 2020 08:42
Run Django database migrations after deploy to Heroku. This file must live at `bin/post_compile` within your root project directory.
# !/usr/bin/env bash
# File path should be ./bin/post_compile
# (.sh extension added in Gist just to enable shell syntax highlighting.
# https://discussion.heroku.com/t/django-automaticlly-run-syncdb-and-migrations-after-heroku-deploy-with-a-buildpack-or-otherwise/466/7
echo "=> Performing database migrations..."
python manage.py migrate