Skip to content

Instantly share code, notes, and snippets.

View vladak's full-sized avatar

Vladimir Kotal vladak

  • Europe
View GitHub Profile
@anecdata
anecdata / safemode.py
Last active May 29, 2024 08:30
CircuitPython 8 safemode.py
# SPDX-FileCopyrightText: 2023 anecdata
#
# SPDX-License-Identifier: MIT
import json
import microcontroller
import supervisor
from ⚙️ import *
@aaronsteers
aaronsteers / github-cicd-workflow.yml
Last active April 2, 2023 20:28
Fully-Managed Python Package using Poetry
# Instructions:
#
# 1. Save this file as `{root}/.github/workflows/cicd.yml`.
# 2. Set the `PYPI_USER` and `PYPI_PASS` secrets in your GitHub CI config.
# 3. Update the `PYPACKAGE_NAME` declaration to the name you want to use in PyPi.
#
# Public Gist: https://gist.github.com/aaronsteers/f3eec4db94d3db1de78b76b3318e9e33
name: Python CI/CD
env:
@fay59
fay59 / Quirks of C.md
Last active January 23, 2024 04:24
Quirks of C

Here's a list of mildly interesting things about the C language that I learned mostly by consuming Clang's ASTs. Although surprises are getting sparser, I might continue to update this document over time.

There are many more mildly interesting features of C++, but the language is literally known for being weird, whereas C is usually considered smaller and simpler, so this is (almost) only about C.

1. Combined type and variable/field declaration, inside a struct scope [https://godbolt.org/g/Rh94Go]

struct foo {
   struct bar {
 int x;
@tstellanova
tstellanova / setup_pigpiod.md
Last active April 26, 2024 09:23
Install pigpiod on Raspberry Pi 3 (RPi3) running raspbian buster

Install pigpio

If you're working with the rpi3's gpio, the pigpio library can be very handy.

sudo apt-get update
sudo apt-get install pigpio 

If you also want to access pigpio from python, install: sudo apt-get install python-pigpio python3-pigpio

Setup pigpiod service to run at boot

- translate all the slide/notes up to and excluding sem API (Vlada)
- translate all the remaining slides for sem API (Jan)
- move System V semaphore API to the appendix, do not translate (Jan)
- change System V sem API in the Syllabus to POSIX sem API (Vlada)
@joyrexus
joyrexus / README.md
Last active February 24, 2024 15:16
collapsible markdown

collapsible markdown?

CLICK ME

yes, even hidden code blocks!

print("hello world!")
@manojpandey
manojpandey / gotchas.md
Last active August 31, 2021 14:52
Attack of Pythons

Attack of Pythons

Among computer programmers, a “gotcha” has become a term for a feature of a programming language that is likely to play tricks on you to display behavior that is different than what you expect.

Just as a fly or a mosquito can “bite” you, we say that a gotcha can “bite” you. So, let's proceed to examine some of Python's gotchas !

alt text


@evantoli
evantoli / GitConfigHttpProxy.md
Last active July 20, 2024 03:29
Configure Git to use a proxy

Configure Git to use a proxy

In Brief

You may need to configure a proxy server if you're having trouble cloning or fetching from a remote repository or getting an error like unable to access '...' Couldn't resolve host '...'.

Consider something like:

@hartror
hartror / limit.py
Created December 23, 2014 03:21
Finding safe ways to limit a forked proccess's memory in Python.
#!/usr/bin/env python
import os
import psutil
import resource
import subprocess
import sys
import time
@jameshfisher
jameshfisher / How to make a private Gist public.md
Created January 5, 2014 16:31
How to make a private Gist public

Github provides no facility to do this via the UI. This is sad, because it would be extremely useful in order to draft something before publishing it. It would also be trivial for them to implement. Never mind; here's how to do it manually:

  1. Get the "Clone this Gist" text from the left-hand side of the private Gist, e.g. https://gist.github.com/b9cc265982870c091a1e.git, and extract the ID b9cc265982870c091a1e.
  2. Go to https://gist.github.com/ and create a dummy new public Gist.
  3. Get the "Clone this Gist" text from the left-hand side, e.g. https://gist.github.com/8270253.git, and extract the ID 8270253.
  4. git clone git@gist.github.com:b9cc265982870c091a1e tmp-dir && cd tmp-dir && git push -f git@gist.github.com:8270253.git