Skip to content

Instantly share code, notes, and snippets.

<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>RimWorld modlist</title>
<link rel="stylesheet" href="https://cdn.rawgit.com/markdowncss/modest/master/css/modest.css">
</head>
<body><h1>RimWorld modlist</h1>
<p>Author: <strong>apk</strong><br />
using System;
using Serilog;
using Narochno.Serilog.Slack;
namespace SlackSinkWithDiscordExample
{
class Program
{
const string discord_webhook =
"https://discordapp.com/api/webhooks/{REDACTED}";
@apkd
apkd / Comment.cs
Last active August 3, 2023 20:01
Double-click the text area to edit. https://tryfinally.dev/unity-comment-component
#if UNITY_EDITOR
using UnityEditor;
using UnityEditor.Callbacks;
#endif
using System;
using System.Linq;
using UnityEngine;
using S = UnityEngine.SerializeField;
/// <summary>
void OnValidate()
{
// remove non-unique and non-prefabs
ReplicablePrefabs =
ReplicablePrefabs
.Where(x => !x || x.IsPrefab())
.AppendItem(null as Replicable)
.Distinct()
.ToList();
WheelRight::^#Right
WheelLeft::^#Left
import { Enumerable } from "powerseq/enumerable";
class KeyValuePair<T> {
key: string;
value: T;
}
class KvpDictionary<T> {
mapping: { [key: string]: T } = {}
public get keys(): Enumerable<string> {
using UnityEngine;
public static partial class QuaternionExtensions
{
/// <summary>
/// Gradually changes a quaternion towards a desired goal over time.
/// The quaternion is smoothed by some spring-damper like function, which will never overshoot.
/// </summary>
/// <param name="current">Current rotation to interpolate from.</param>
/// <param name="target">Target rotation to interpolate to.</param>
@apkd
apkd / vscode-style.css
Created October 3, 2017 17:34
vscode stylesheet customization
.mtk4 {
font-family: 'Operator Mono Light';
font-style: italic;
font-size: 1.21em;
}
.monaco-workbench .panel.integrated-terminal .xterm .xterm-rows {
color: #fffeca;
font-family: "Monoid" !important;
font-size: 9px !important;
@apkd
apkd / download-video.ps1
Last active October 22, 2017 21:12
Powershell/batch script to download video using StreamLink (takes link from clipboard)
add-type -as System.Windows.Forms;
$url = [windows.forms.clipboard]::GetText()
$arr = $url.split("/")
$arr = $arr[$arr.length - 1].split("=")
$filename = $arr[$arr.length - 1]
echo $filename
&"streamlink" $url "best" "--out" "$($filename).mp4"
/*
*
* Push Notifications codelab
* Copyright 2015 Google Inc. All rights reserved.
*
* 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
*
* https://www.apache.org/licenses/LICENSE-2.0