Skip to content

Instantly share code, notes, and snippets.

View webknjaz's full-sized avatar
🇺🇦
#StandWithUkraine: https://github.com/vshymanskyy/StandWithUkraine

🇺🇦 Sviatoslav Sydorenko (Святослав Сидоренко) webknjaz

🇺🇦
#StandWithUkraine: https://github.com/vshymanskyy/StandWithUkraine
View GitHub Profile
@jdunck
jdunck / circle.yml.fragment
Last active January 19, 2018 16:16
py.test parallel execution for CircleCI
test:
override:
- find . -maxdepth 1 -type d -not -name . > test_dirs:
parallel: true
- python circle_node_to_dirs.py < test_dirs > test_dirs_for_node:
parallel: true
- echo "Testing `cat test_dirs_for_node`":
parallel: true
- py.test `cat test_dirs_for_node`:
parallel: true
@thatarchguy
thatarchguy / vpnwidget.lua
Created October 21, 2014 23:58
Awesomewm vpn widget
-- add this to your rc.lua, or include it as a dependency
-- Don't forget to add this to the layout section:
-- right_layout:add(vpnwidget)
vpnwidget = wibox.widget.textbox()
vpnwidget:set_text(" VPN: N/A ")
@mbbx6spp
mbbx6spp / README.md
Last active September 26, 2025 13:22
Gerrit vs Github for code review and codebase management

Gerrit vs Github: for code review and codebase management

Sure, Github wins on the UI. Hands down. But, despite my initial annoyance with Gerrit when I first started using it almost a year ago, I am now a convert. Fully. Let me tell you why.

Note: This is an opinionated (on purpose) piece. I assume your preferences are like mine on certain ideas, such as:

  • Fast-forward submits to the target branch are better than allowing merge commits to the target branch. The reason I personally prefer this is that, even if a non-conflicting merge to the target branch is possible, the fact that the review/pull request is not up to date with the latest on the target branch means feature branch test suite runs in the CI pipeline reporting on the review/PR may not be accurate. Another minor point is that forced merge commits are annoying as fuck (opinion) and clutter up Git log histories unnecessarily and I prefer clean histories.
  • Atomic/related changes all in one commit is something worth striving for. Having your dev
@amatellanes
amatellanes / pytest.sh
Last active October 28, 2025 14:04
Useful py.test commands.
py.test test_sample.py --collect-only # collects information test suite
py.test test_sample.py -v # outputs verbose messages
py.test -q test_sample.py # omit filename output
python -m pytest -q test_sample.py # calling pytest through python
py.test --markers # show available markers
@probonopd
probonopd / gist:e5447a774899006af57f
Last active January 4, 2025 19:45
Modify stock OpenWrt installation to be a DHCP client and to use USB storage to expand capacity; provide TimeCapsule service
# Installed barrier_breaker rc2 OpenWrt image
# Set computer to 192.168.1.2
telnet 192.168.1.1
passwd
# Set new root password; this enables ssh
# Set up the wired network interface as a DCHP client
cat > /etc/config/network <<\EOF
@sebdah
sebdah / fibonacci.py
Last active July 13, 2021 09:33
Fibonacci generator in Python
def fibonacci():
""" Generator yielding Fibonacci numbers
:returns: int -- Fibonacci number as an integer
"""
x, y = 0, 1
while True:
yield x
x, y = y, x + y
@sebdah
sebdah / quicksort.py
Created August 4, 2014 07:58
Quicksort implementation in Python
""" Quicksort implementation """
def quicksort(arr):
""" Quicksort a list
:type arr: list
:param arr: List to sort
:returns: list -- Sorted list
"""
@allanlei
allanlei / gist:8ea15ceeae93447f7212
Created July 16, 2014 03:31
Running twisted application without twistd
from twisted.web.resource import Resource
from twisted.internet import reactor
from twisted.web.static import File
from twisted.web import server
from twisted.application import internet, service
from twisted.application.app import startApplication
from twisted.web.wsgi import WSGIResource
from twisted.runner.procmon import ProcessMonitor
from twisted.web import vhost, static
@tristanfisher
tristanfisher / Ansible-Vault how-to.md
Last active August 27, 2025 16:19
A short tutorial on how to use Vault in your Ansible workflow. Ansible-vault allows you to more safely store sensitive information in a source code repository or on disk.

Working with ansible-vault


I've been using a lot of Ansible lately and while almost everything has been great, finding a clean way to implement ansible-vault wasn't immediately apparent.

What I decided on was the following: put your secret information into a vars file, reference that vars file from your task, and encrypt the whole vars file using ansible-vault encrypt.

Let's use an example: You're writing an Ansible role and want to encrypt the spoiler for the movie Aliens.

@ryanj
ryanj / gist-reveal.it-slides.html
Last active July 15, 2025 09:04
Gist-powered Revealjs slideshow presentations http://gist-reveal.it
<section id='hello' data-background-transition='zoom' data-transition='concave' data-background='https://ryanjarvinen.com/presentations/shared/img/broadcast_reveal_dark.png' data-state='blackout'>
<h1><a style='color:deepskyblue;' href='https://gist-reveal.it'>gist-reveal.it</a></h1>
<br/>
<h2 style='color:white;'>Gist-Powered</h2>
<h1 style='white-space:nowrap;color:white;'>reveal.js slides</h1>
<p><small style="background-color: rgb(0,0,0,0.35); font-style: italic; color: white;"> press F1 for usage notes </small></p>
</section>
<section id='revealjs' data-transition='concave'>
<h3><a href="https://revealjs.com/">Reveal.js</a> is a framework</h3><p><span>for crafting presentations</span><br/> <span class='fragment'>in <a href="https://revealjs.com/markup/">HTML</a></span> <br/> <span class='fragment fade-up'>and <a href="https://revealjs.com/markdown/">Markdown</a></span>
<aside class="notes">Oh hey, these are some notes. They'll be hidden in your presentation, but you can see them if you open