Skip to content

Instantly share code, notes, and snippets.

View nbeuchat's full-sized avatar

Nicolas Beuchat nbeuchat

View GitHub Profile
@derlin
derlin / PCSwissFrench.keylayout
Last active July 18, 2024 07:15
PC layout Swiss-French for MacOS
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE keyboard PUBLIC "" "file://localhost/System/Library/DTDs/KeyboardLayout.dtd">
<!-- Key mapping for PC-style keys with Swiss French layout -->
<!--Last edited by Ukelele version 2.2.8 on 2015-06-02 at 17:10 (CEST)-->
<keyboard group="0" id="16101" name="PC Swiss French" maxout="1">
<layouts>
<layout first="0" last="0" modifiers="commonModifiers" mapSet="ISO"/>
</layouts>
<modifierMap id="commonModifiers" defaultIndex="0">
<keyMapSelect mapIndex="0">
@siddhuwarrier
siddhuwarrier / ubuntu_port_forwarding
Last active September 14, 2018 12:00
Port forward from port 9000 to port 80 on an Ubuntu machine using IPtables (exposing Sonar on port 80)
# iptables -A PREROUTING -t nat -i eth0 -p tcp --dport 80 -j REDIRECT --to-port 9000
# iptables-save
@jhgaylor
jhgaylor / through_relationships.py
Last active September 24, 2024 10:11
Example of using a through model in Django and filtering by a value on the custom through model.
class A(models.Model):
things = models.ManyToManyField("B", through=ThroughModel)
class B(models.Model):
text = models.TextField()
class ThroughModel(models.Model):
a = models.ForeignKey(A)
b = models.ForeignKey(B)
extra = models.BooleanField()