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
from inspect import signature | |
from functools import wraps | |
def dec(func): | |
def wrapper(*args, **kwargs): | |
return func(*args, **kwargs) | |
return wrapper | |
def dec2(func): | |
@wraps(func) |
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
namespace AlarmNamespace | |
{ | |
public class AlarmEventArgs : EventArgs | |
{ | |
private DateTime alarmTime; | |
private bool snoozeOn = true; | |
public AlarmEventArgs (DateTime time) | |
{ | |
this.alarmTime = time; |
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
""" | |
Archive branches that are merged into master. | |
This is done by tagging them as archive/<branchname> and removing them both locally and | |
remotely. Before each operation, the user is asked for confirmation. | |
""" | |
# This dependency can be found on github: https://github.com/Chiel92/python-shellout | |
from shellout import get, out, confirm | |
# Tag merged branches |
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 re | |
from shellout import get, out | |
errors = get('cat errors.txt') | |
# Fix missing explicit keyword using vim | |
# Where explicit.vim contains: | |
# exe "normal 0wiexplicit \<esc>" | |
# wq |
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 re | |
from shellout import out | |
errors = out('cat errors.txt') | |
regex = re.compile(r"\[(?P<filename>[^:]+):(?P<linenumber>\d+)\]: \(performance\) " | |
"Function parameter '(?P<argumentname>[^']+)'") | |
matches = regex.findall(errors) | |
for match in matches: | |
d = match.groupdict() |
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/bash | |
exitcode=0 | |
root=`git rev-parse --show-toplevel` | |
echo "Root of repository: $root" | |
echo | |
cd "$root/Source" | |
source_files=$(find . \( -name \*.h -or -name \*.cpp \) \ |
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 * as vscode from 'vscode'; | |
// this method is called when your extension is activated | |
export function activate(context: vscode.ExtensionContext) { | |
// Decoration types are very expensive to make, so we create them once and then reuse them. | |
// The decoration types are indexed by the amount of spaces they add. | |
let decorationType = vscode.window.createTextEditorDecorationType({ border: "1px solid red", letterSpacing: "-0.5ch" }); | |
let decorationRanges: vscode.Range[] = []; | |
const updateDecorations = (editor: vscode.TextEditor | undefined) => { |
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
using System; | |
namespace Utils; | |
/// <summary> | |
/// "Nullable" wrapper. Can wrap both value types and reference types. | |
/// </summary> | |
/// <typeparam name="T"></typeparam> | |
public readonly struct Option<T> : IEquatable<Option<T>> | |
{ |
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/bash | |
cp ~/.steam/steam/steamapps/common/AoE2DE/vc_redist.x64.exe ~/.steam/steam/steamapps/compatdata/813780/pfx/drive_c/windows/system32/vc_redist.x64.exe | |
cd ~/.steam/steam/steamapps/compatdata/813780/pfx/drive_c/windows/system32/ | |
sudo cabextract vc_redist.x64.exe | |
sudo cabextract a10 | |
sudo chown -R $USER:$USER . |
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 std/core/unsafe | |
import std/core/undiv | |
pub fun debug(msg : string) : total () | |
unsafe-total({println(msg)}) | |
pub effect yield<a> | |
ctl yield(elem : a) : () |