Skip to content

Instantly share code, notes, and snippets.

View fallenhitokiri's full-sized avatar

Timo Zimmermann fallenhitokiri

View GitHub Profile
@dypsilon
dypsilon / frontendDevlopmentBookmarks.md
Last active April 30, 2024 04:42
A badass list of frontend development resources I collected over time.
@aras-p
aras-p / preprocessor_fun.h
Last active April 28, 2024 15:25
Things to commit just before leaving your job
// Just before switching jobs:
// Add one of these.
// Preferably into the same commit where you do a large merge.
//
// This started as a tweet with a joke of "C++ pro-tip: #define private public",
// and then it quickly escalated into more and more evil suggestions.
// I've tried to capture interesting suggestions here.
//
// Contributors: @r2d2rigo, @joeldevahl, @msinilo, @_Humus_,
// @YuriyODonnell, @rygorous, @cmuratori, @mike_acton, @grumpygiant,
const apiUrl = "https://pass.telekom.de/api/service/generic/v1/status"
let widget = await createWidget()
widget.backgroundColor = new Color("#777777")
if (!config.runsInWidget) {
await widget.presentSmall()
}
Script.setWidget(widget)
Script.complete()
@nealfennimore
nealfennimore / wireguard.conf
Last active April 3, 2024 09:49
Wireguard VPN - Forward all traffic to server
# ------------------------------------------------
# Config files are located in /etc/wireguard/wg0
# ------------------------------------------------
# ---------- Server Config ----------
[Interface]
Address = 10.10.0.1/24 # IPV4 CIDR
Address = fd86:ea04:1111::1/64 # IPV6 CIDR
PostUp = iptables -A FORWARD -i wg0 -j ACCEPT; iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE; ip6tables -A FORWARD -i wg0 -j ACCEPT; ip6tables -t nat -A POSTROUTING -o eth0 -j MASQUERADE # Add forwarding when VPN is started
PostDown = iptables -D FORWARD -i wg0 -j ACCEPT; iptables -t nat -D POSTROUTING -o eth0 -j MASQUERADE; ip6tables -D FORWARD -i wg0 -j ACCEPT; ip6tables -t nat -D POSTROUTING -o eth0 -j MASQUERADE # Remove forwarding when VPN is shutdown
@jefftriplett
jefftriplett / python-django-postgres-ci.yml
Last active March 27, 2024 04:27
This is a good starting point for getting Python, Django, Postgres running as a service, pytest, black, and pip caching rolling with GitHub Actions.
name: CI
on: [push]
jobs:
test:
runs-on: ubuntu-latest
services:
@pierremarc
pierremarc / test_cc.py
Created September 19, 2012 15:21
Add files to a repo with pygit2
"""
test commit creation with pygit2
To see the result:
rm -rf foo && python test_cc.py && cd foo/ && git log --graph --oneline --date-order --decorate --color --all && git status && cd ..
"""
import os
import sys
import pygit2
@rmhall
rmhall / itunes_match_tips.txt
Created November 22, 2011 21:08
iTunes Match tips
My iTunes Match Track upgrading and process info:
If you have less than 25,000 tracks:
1. First let iTunes Match do its things and find all possible matches in your library and finish uploading any non-matching tracks.
2. Once its done, make a new Smart Playlist (I made a folder for all my Smart iTunes Match Related Playlists)
Name this one: iCloud-Upgradeable
Criteria:
MATCH ALL:
Bit Rate is less than 256kbps
@fadur
fadur / custom_manager.py
Created June 25, 2011 21:57
Subclassing django's QuerySet
from django.db import models, connection
class SearchQuerySet(models.query.QuerySet):
"""SearchQuerySet"""
def __init__(self, model=None, fields=None, using=None, query=None):
super(SearchQuerySet, self).__init__(model, query, using)
self._search_fields = fields
def search(self, squery):
@maccman
maccman / juggernaut.rb
Created June 26, 2012 02:49
Sinatra Server Side Event streaming.
# Usage: redis-cli publish message hello
require 'sinatra'
require 'redis'
conns = []
get '/' do
erb :index
end
@pamelafox
pamelafox / send.js
Created November 7, 2011 21:21
CORS XHR (jQuery/Flask)
function sendData(url, data, onSuccess, onError) {
$.ajax({
url: url,
type: 'POST',
data: data,
dataType: 'json',
xhrFields: {
withCredentials: true
},