Skip to content

Instantly share code, notes, and snippets.

View extrawurst's full-sized avatar
💭
→☕️→👨‍💻→♥️

extrawurst

💭
→☕️→👨‍💻→♥️
View GitHub Profile
@extrawurst
extrawurst / PrivacyInfo.xcprivacy
Created March 24, 2024 16:36
Bevy iOS PrivacyInfo
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>NSPrivacyAccessedAPITypes</key>
<array>
<dict>
<key>NSPrivacyAccessedAPIType</key>
<string>NSPrivacyAccessedAPICategoryFileTimestamp</string>
<key>NSPrivacyAccessedAPITypeReasons</key>
var level = Substitute.For<ILevel>();
var buildings = Substitute.For<IBuildings>();
// test subject:
var build = new BuildController(null,buildings,level);
// smoke test
Assert.AreEqual(0, build.GetCurrentBuildCount());
// assert that `GetCurrent` was exactly called once
struct MessageType {}
bus.Subscribe<MessageType>(()=>Debug.Log("Msg received"));
bus.Fire<MessageType>();
#[export]
fn _draw(&self, owner: &CanvasItem) {
let start_time = OS::godot_singleton().get_ticks_usec();
let cntf = self.cnt as f32;
for n in 0..self.cnt {
let x = f32::sin(n as f32 / cntf * 360.0) * self.rad;
let y = f32::cos(n as f32 / cntf * 360.0) * self.rad;
let target = Vector2::new(x, y) + self.start;
extends CanvasItem
# how many lines to draw? (this can be adjusted from the editor UI)
export var cnt = 6000
# this is the center point
export var start = Vector2(250,250)
# radius (line length)
export var rad = 200
func _draw():
@extrawurst
extrawurst / config
Last active October 12, 2020 19:32
.cargo/config for android linking (see also https://gist.github.com/extrawurst/ae3fd3ef152a878acfdc860db025e886)
[target.armv7-linux-androideabi]
linker = "/NDK/arm/bin/arm-linux-androideabi-clang"
[target.aarch64-linux-android]
linker = "/NDK/arm64/bin/aarch64-linux-android-clang"
[target.i686-linux-android]
linker = "/NDK/x86/bin/i686-linux-android-clang"
[target.x86_64-linux-android]
@extrawurst
extrawurst / Dockerfile
Last active October 12, 2020 19:32
build rust android lib with ndk-r18b (see also linker config: https://gist.github.com/extrawurst/3e0ad8bc967e70c0e04aefdec3172c45)
FROM ubuntu
RUN apt-get update
RUN DEBIAN_FRONTEND="noninteractive" apt-get -y install tzdata
RUN apt-get install -yq sudo curl wget git file g++ cmake pkg-config \
libasound2-dev bison flex unzip ant openjdk-8-jdk \
lib32stdc++6 lib32z1 libssl-dev python \
g++-multilib gcc-multilib libc6-dev-i386 llvm-dev libclang-dev clang
RUN apt-get install -yq libncurses5 libncurses5-dev && \
apt-get clean
globaldb:PRIMARY> db.users.count({test:"TelescopeTest2",group:"Test"})
9721
globaldb:PRIMARY> db.runCommand({getLastRequestStatistics:1})
{
"CommandName" : "count",
"RequestCharge" : 1203.82,
"RequestDurationInMilliSeconds" : NumberLong(318),
"ActivityId" : "0e3e093f-9af8-459a-99ed-53113b138197",
"ok" : 1
@extrawurst
extrawurst / gist:6385e793a841111a6f81c71f18be1edf
Created August 22, 2020 08:22
cosmos db compound index count RU issue
globaldb:PRIMARY> db.users.count({test:"TelescopeTest2",created:{$gte:"2020-08-20T06:00:00Z"}})
29239
globaldb:PRIMARY> db.runCommand({getLastRequestStatistics:1})
{
"CommandName" : "count",
"RequestCharge" : 1290.15,
"RequestDurationInMilliSeconds" : NumberLong(268),
"ActivityId" : "f94b30bb-3599-49a7-a888-982827b6be51",
"ok" : 1
db.users.getIndexes()
[
{
"v" : 1,
"key" : {
"_id" : 1
},
"name" : "_id_",
"ns" : "telescope.users"
},