Skip to content

Instantly share code, notes, and snippets.

View WildGenie's full-sized avatar
๐Ÿค–
I โค๏ธ Machine Learning

Bilgehan Zeki ร–ZAYTAร‡ WildGenie

๐Ÿค–
I โค๏ธ Machine Learning
View GitHub Profile
@WildGenie
WildGenie / install-anbox-dkms-fedora.sh
Created June 29, 2021 02:32 — forked from sr229/install-anbox-dkms-fedora.sh
Automated Script to Install Anbox Ashmem and Binder to WSL2 Linux Kernel
#!/bin/bash
set -o pipefail
KERNEL_WORKING_DIRECTORY="/usr/src"
KERNEL_VERSION=$(uname -r)
REQUIRED_DEPENDENCIES="git bison flex elfutils-libelf-devel openssl-devel"
KERNEL_SRC_DIR="$KERNEL_WORKING_DIRECTORY/WSL2-Linux-Kernel-$(uname -r)"
echo "Warning: This script has to be run on sudo permissions. If you encounter issues please report it immediately."
@WildGenie
WildGenie / AddRating.cs
Created June 25, 2021 01:03 — forked from bradygaster/AddRating.cs
Contoso Crafts
public void AddRating(string productId, int rating)
{
var products = GetProducts();
var query = products.First(x => x.Id == productId);
if(query.Ratings == null)
{
query.Ratings = new int[] { rating };
}
else
@WildGenie
WildGenie / README.md
Created March 31, 2021 18:11 — forked from cerebrate/README.md
Recompile your WSL2 kernel - support for snaps, apparmor, lxc, etc.

NOTE

See https://gist.github.com/cerebrate/d40c89d3fa89594e1b1538b2ce9d2720#gistcomment-3563688 below before doing anything else.

Recompile your WSL2 kernel - support for snaps, apparmor, lxc, etc.

Yes, I've done this, and yes, it works. It is, however, entirely unsupported and assembled through reasonable guesswork, so if you try this and it explodes your computer, brain, career, relationships, or anything else, you agree that you take sole responsibility for doing it, that I never claimed it was a good idea, and that you didn't get these instructions from me .

@WildGenie
WildGenie / Notes.md
Created March 16, 2021 00:33 — forked from Keboo/Notes.md
Presenting / Streaming notes

Personal notes on presenting and streaming.

Before starting

  • Turn off un-needed software. Especially things with notifications: Slack, Skype, Teams, etc.
  • Turn on Focus Assist
  • When sharing your desktop, consider sharing a secondary screen rather than the primary screen. Many apps will post notifications to the primary screen so this will help cut down on accidently sharing out notifications.
  • Hide desktop icons
  • Consider resolution/DPI. Remember that for streaming, people watching may be on lower resolutions; don't stream above 1080p.
  • Hide task bar. Either set auto hide, or simply crop the shared section of your screen to omit it.
  • Consider if desktop background is appropriate.
@WildGenie
WildGenie / IQueryableExtensions.cs
Created February 28, 2021 15:54 — forked from ErikEJ/IQueryableExtensions.cs
Replacement for EF Core .Contains, that avoids SQL Server plan cache pollution
public static class IQueryableExtensions
{
public static IQueryable<TQuery> In<TKey, TQuery>(
this IQueryable<TQuery> queryable,
IEnumerable<TKey> values,
Expression<Func<TQuery, TKey>> keySelector)
{
if (values == null)
{
@WildGenie
WildGenie / dllinjshim.cpp
Created February 7, 2021 23:47 — forked from w4kfu/dllinjshim.cpp
DLL Injection via Shim
/*
-------- dllinjshim.cpp --------
> cl /Fe:dllinjshim.exe dllinjshim.cpp
> dllinjshim.exe
> sdbinst moo.sdb
/!\ On Windows 10 there is a new function `SdbIsKnownShimDll` called
in `SdbGetDllPath` which will check the DLL name against the following list:
@WildGenie
WildGenie / rearct-native-app-in-wsl2.md
Created January 29, 2021 04:51 — forked from bergmannjg/rearct-native-app-in-wsl2.md
Building a react native app in WSL2
@WildGenie
WildGenie / README.ja.md
Created January 21, 2021 02:36 — forked from niw/README.en.md
How to run Windows 10 on ARM or Ubuntu for ARM64 in QEMU on Apple Silicon Mac

ARM ็‰ˆ Windows 10 ใ‚„ Ubuntu for ARM64 ใ‚’ Apple Silicon ใช Mac ใงๅ‹•ใ‹ใ™

ARM ็‰ˆ Windows 10 ใ‚„ Ubuntu ใ‚’ Apple Silicon ใช Mac ใงๅ‹•ใ‹ใ™็ฐกๅ˜ใชๆ–นๆณ•ใงใ™ใ€‚

ใƒกใƒข: 2020ๅนด12ๆœˆ19ๆ—ฅ็พๆ™‚็‚นใงใฎๆ–นๆณ•ใงใ€ไปŠๅพŒใŠใŠใใๆ”นๅ–„ใ•ใ‚Œใฆใ„ใใจๆ€ใ„ใพใ™(ใ ใจใ„ใ„ใชใ€‚)

ARM ็‰ˆ Windows 10 ใ‚’ๅ‹•ใ‹ใ™

  1. Xcode ใ‚’ App Store ใงใ€ใ‚ใ‚‹ใ„ใฏ Command Line Tools ใ‚’ Apple Silicon ใช Mac ใซใ‚คใƒณใ‚นใƒˆใƒผใƒซ
class Todo:
todos = []
selectedIndex = None
FILENAME = "todos.txt"
def addJob(self, job):
self.todos.append(job)
def removeJob(self, index=None):
self.todos.pop((index or self.selectedIndex) - 1)
#include <stdio.h>
#include <stdbool.h>
int rnd(int min_num, int max_num)
{
int result = 0, low_num = 0, hi_num = 0;
if (min_num < max_num)
{
low_num = min_num;