This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# A dotfile to turn iTerm2 tabs a different colour based on the command glob. | |
# Useful for marking different environments in different colours. | |
# Cargo-culted from multiple sources, apologies for not fully acknowledging them :( | |
# Edit the line that reads "if [[ "$1" =~ "^(login-helper) " ]]; then" and replace | |
# "login-helper" with whatever command you use to authenticate. Then modify the case | |
# statement to match your auth command's arguments. For example: you may use a script | |
# called "authsaml" to authenticate, and its arguments are dev, test, preprd, and prd. | |
# Change the colour function you call if you want to change tab colours. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
javascript:(function() { const MY_CATEGORIES = ['AREA', 'WAYPOINT', 'UNIQUE ARMOR', 'UNIQUE WEAPON', 'SIDE QUEST']; document.querySelectorAll('#categories .category-item').forEach(e => { e.classList.contains('category-visible') && e.click(); MY_CATEGORIES.includes(e.querySelector('span[class=\"title\"]').innerText) && e.click(); }); })(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
G91 ;Relative positioning | |
G1 E-2 F2700 ;Retract a bit | |
G1 E-2 Z0.2 F2400 ;Retract and raise Z | |
G1 X5 Y5 F3000 ;Wipe out | |
G1 Z10 ;Raise Z more | |
G90 ;Absolute positioning | |
G1 X0 Y{machine_depth} ;Present print | |
M106 S0 ;Turn-off fan | |
M104 S0 ;Turn-off hotend |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/xcrun swift | |
// | |
// Copyright © 2016 Leon Breedt | |
// Ported to Swift 5 by Pablo Morelli 2019 | |
// | |
// Licensed under the Apache License, Version 2.0 (the "License"); | |
// you may not use this file except in compliance with the License. | |
// You may obtain a copy of the License at | |
// | |
// http://www.apache.org/licenses/LICENSE-2.0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# This is Git's per-user configuration file. | |
[push] | |
default = simple | |
[user] | |
name = tspng | |
email = tspng@socket.ch | |
[core] | |
excludesfile = /Users/tspng/.gitignore_global | |
[http] | |
# allow large deltas to be pushed |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import unittest | |
from sqlalchemy import Column, Integer, ForeignKey, create_engine, event | |
from sqlalchemy.orm import backref, relationship, sessionmaker | |
from sqlalchemy.ext.declarative import declarative_base | |
from sqlalchemy.exc import IntegrityError | |
from sqlalchemy.engine import Engine | |
Base = declarative_base() | |
engine = create_engine('sqlite://') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Image(db.Model): | |
id = db.Column(db.Integer, primary_key=True) | |
url = db.Column(db.String(255)) | |
class ThingWithImage(db.Model): | |
id = db.Column(db.Integer, primary_key=True) | |
image_id = db.Column(db.Integer, db.ForeignKey("image.id")) | |
image = db.relationship("Image", foreign_keys=[image_id]) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class _ForUserQuery(BaseQuery): | |
def _get_client_user_query(self): | |
raise NotImplementedError | |
def _get_pk_field(self): | |
raise NotImplementedError | |
def for_user(self, user): | |
query = self._get_client_user_query() | |
if not user.is_admin: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
OC_CONFIG="EFI/OC/config.plist" | |
HIDDEN_VALUE="__GENERATE_YOUR_OWN__" | |
MODIFIED=0 | |
hide_value() { | |
key=$1 | |
found=`grep -A1 "<key>${key}</key>" ${OC_CONFIG} | grep ${HIDDEN_VALUE} | wc -l` | |
if [ $found -eq 0 ]; then |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import pytest | |
from backend import create_app | |
from backend.auth.models import User, Role | |
@pytest.fixture(scope="session") | |
def monkeypatch_session(request): | |
""" | |
Experimental session scoped monkeypatch fixture, see |
NewerOlder