Skip to content

Instantly share code, notes, and snippets.

View Kyu's full-sized avatar
😜
I like doing shit

Precious Kyu

😜
I like doing shit
View GitHub Profile
@eknight7
eknight7 / BUILD
Last active February 8, 2023 06:24
Multi-Hand Tracking via Live Webcam on CPU on Desktop: Shows how to extract landmarks on desktop.
// Copyright 2019 The MediaPipe Authors.
//
// 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
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
@vorce
vorce / jerry.swift
Last active May 4, 2024 15:02
Mouse move and click test thing for macos in swift
import Cocoa
import Foundation
// Move around and click automatically at random places in macos, kinda human like in a cheap way.
// Moves the mouse pointer to `moves` random locations on the screen and runs the `action` function at
// each point with the point as argument.
func mouseMoveWithAction(moves: Int, action: (CGPoint) -> Void = defaultAction) {
let screenSize = NSScreen.main?.visibleFrame.size
@sgdan
sgdan / dockerignore-test.sh
Created May 11, 2019 23:58
Test the ".dockerignore" file to ensure the build context doesn't contain unwanted files
#!/bin/sh
# Based on BMitch's answer from:
# https://stackoverflow.com/questions/38946683/how-to-test-dockerignore-file
# Note: will create and delete temporary file "Dockerfile.build-context"
# 1. Copy to project folder where image is being built
# 2. Run script
# 3. You should see list of files in build context
@Cadiboo
Cadiboo / Conventions.md
Last active July 2, 2023 14:23
Conventions (WIP)

What, Why, Consequences of not doing it, How to do it right

Required Java conventions

What: Lowercase package naming.
Why: Some file systems (windows) consider iTeMs and items to be the same, but every other system considers them to be different.
Consequences: Not doing this may never cause any issues (and very likely won't in your dev environment), but on other operating systems with different case-sensitivities from yours this can cause massive problems.
How: Name your packages all in lowercase.

What: Packaging that reflects your web presence.
Why: Avoid name collisions - your web presence is unique so it is commonly used.
Consequences: Errors loading classes with other mods installed, usually happens when 2 mods never changed their packaging from the default in the MDK.

@xirixiz
xirixiz / Set up GitHub push with SSH keys.md
Last active May 4, 2024 11:08 — forked from developius/README.md
Set up GitHub push with SSH keys

SSH keypair setup for GitHub (or GitHub/GitLab/BitBucket, etc, etc)

Create a repo.

Make sure there is at least one file in it (even just the README.md)

Generate a SSH key pair (private/public):

ssh-keygen -t rsa -C "your_email@example.com"
@jamesfreeman959
jamesfreeman959 / keepawake.ps1
Last active April 30, 2024 04:23
A very simple PowerShell script to keep a Windows PC awake and make lync think the user is active on the keyboard
# Useful references:
#
# https://superuser.com/questions/992511/emulate-a-keyboard-button-via-the-command-line
# https://ss64.com/vb/sendkeys.html
# https://social.technet.microsoft.com/Forums/windowsserver/en-US/96b339e2-e9da-4802-a66d-be619aeb21ac/execute-function-one-time-in-every-10-mins-in-windows-powershell?forum=winserverpowershell
# https://learn-powershell.net/2013/02/08/powershell-and-events-object-events/
#
# Future enhancements - use events rather than an infinite loop
$wsh = New-Object -ComObject WScript.Shell
while (1) {
@jakesherman
jakesherman / try_except.py
Created September 10, 2017 12:27
Try/except decorator in Python
def try_except(func):
"""Try/Except decorator - takes as input a function, and outputs
a modified version of that function whose first argument is how
many times you want to re-run the function if any exception is
raised.
"""
def try_except_function(num_tries, *args, **kwargs):
"""Modified version of func - see docstring for try_except().
"""
for i in range(num_tries):
@aaangeletakis
aaangeletakis / How-To-Install-SDL-On-Ubuntu.md
Last active February 20, 2024 17:55
How do I install SDL on ubuntu?

What you need to do to install SDL is:

#install sdl2
sudo apt install libsdl2-dev libsdl2-2.0-0 -y;

#install sdl image  - if you want to display images
sudo apt install libjpeg-dev libwebp-dev libtiff5-dev libsdl2-image-dev libsdl2-image-2.0-0 -y;

#install sdl mixer  - if you want sound
@swillits
swillits / Keycodes.swift
Last active March 26, 2024 23:20
Swift Keyboard Keycodes
struct Keycode {
// Layout-independent Keys
// eg.These key codes are always the same key on all layouts.
static let returnKey : UInt16 = 0x24
static let enter : UInt16 = 0x4C
static let tab : UInt16 = 0x30
static let space : UInt16 = 0x31
static let delete : UInt16 = 0x33
static let escape : UInt16 = 0x35
@kupiakos
kupiakos / requirements.txt
Last active January 21, 2018 03:01
/r/upvoteexeggutor full subreddit generator script
Pillow
praw==3.4.0