Skip to content

Instantly share code, notes, and snippets.

View Sakurina's full-sized avatar

Yanik Magnan Sakurina

View GitHub Profile
@prologic
prologic / LearnGoIn5mins.md
Last active July 3, 2024 04:05
Learn Go in ~5mins
Readme: In the following pseudo code, [] indicates a subroutine.
Sometimes I choose to write the subroutine inline under the [] in order to maintain context.
One important fact about the way rollbacks are handled here is that we are storing state for every frame.
In any real implementation you only need to store one game state at a time. Storing a game
state for every frame allows us to only rollback to the first frame where the predicted inputs don't match the true ones.
==Constants==
MAX_ROLLBACK_FRAMES := Any Positive Integer # Specifies the maximum number of frames that can be resimulated
FRAME_ADVANTAGE_LIMIT := Any Positive Integer # Specifies the number of frames the local client can progress ahead of the remote client before time synchronizing.
@zonia3000
zonia3000 / android-static-tethering-howto.md
Last active January 5, 2024 16:22
Android USB tethering with static IP address (fix broken tethering)

Android USB tethering with static IP address (fix broken tethering)

On the custom ROM I'm using (James Rom D500) there is something broken with DHCP setup, so, even if the USB tethering is active from phone settings, the computer will never receive a valid IP address.

These steps worked for me for setting up a static IP address:

Laptop configuration (from GUI)

  • Address: 192.168.42.121
@wilm0x42
wilm0x42 / GPF_Doc.md
Last active August 26, 2022 13:21
How exactly the elusive GPF format works

The heck is this?

Gecko Patch File format, or GPF, is a feature of Gecko OS that the internet seems to have overlooked. (A google search yields just short of anything meaningful) This document aims to explain how to use this feature without the need to reverse engineer the source code.

But what's it DO?

GCT files, which you should be quite familiar with, contain code for Gecko OS to interpret and execute during gameplay. GPF files, on the other hand, simply contain chunks of data for Gecko OS to write out over specified places in memory, before the game boots. Here's how the format describes this information:

@inamiy
inamiy / SwiftElmFrameworkList.md
Last active March 11, 2024 10:20
React & Elm inspired frameworks in Swift
@chrisob
chrisob / reverse-tether.sh
Last active January 22, 2024 12:26
Android reverse tethering over bridged SSH tap interface
#!/bin/bash
# Based on the scripts written by class101 of xda-developers.com:
# http://forum.xda-developers.com/showpost.php?p=57490025&postcount=205
#
# This script enables a secure tunnel for your android phone to "reverse tether"
# and access the internet/a private network via the following steps:
#
# 1. Establish a level 3 (TAP) tunnel from your local host to a remote server via SSH (tap0)
# 2. Establish a level 3 interface between your local host and your android phone via USB (usb0)
@0xabad1dea
0xabad1dea / weird-machines-video-games.md
Last active December 28, 2021 17:38
Weird Machines in Video Games

Abadidea's Index of Weird Machines in Video Games

A "weird machine" is when user-supplied input is able to create an arbitrary new program running within an existing program due to Turing-completeness being exposed. Sometimes such functionality was deliberately included but it is often the result of exploitation of memory corruption. You can learn more at the langsec site. There is a good argument for weird machines being inherently dangerous, but this index is just for fun.

It is broken into two categories: intentional gameplay features which may be used as weird machines, and exploit-based machines which can be triggered by ordinary player input (tool-assisted for speed and precision is acceptable). Games with the sole purpose of programming (such as Core Wars) are not eligible and plugin APIs don't count. If you know of more, feel free to add a comment to this gist.

Intentional Gameplay Mechanics

@luca-bernardi
luca-bernardi / AVAsset+VideoOrientation.h
Created February 23, 2013 18:12
Find the video orientation of an AVAsset. (Useful if you need to send the video to a remote server)
//
// AVAsset+VideoOrientation.h
//
// Created by Luca Bernardi on 19/09/12.
// Copyright (c) 2012 Luca Bernardi. All rights reserved.
//
#import <AVFoundation/AVFoundation.h>
typedef enum {
LBVideoOrientationUp, //Device starts recording in Portrait
@robinsloan
robinsloan / langoliers.rb
Last active June 25, 2024 17:12
The Langoliers, a tweet deletion script
require "rubygems"
require "twitter"
require "json"
# things you must configure
TWITTER_USER = "your_username"
MAX_AGE_IN_DAYS = 1 # anything older than this is deleted
# get these from dev.twitter.com
CONSUMER_KEY = "your_consumer_key"
@mikeabdullah
mikeabdullah / KSPowerAssertion.h
Created August 4, 2012 15:13
KSPowerAssertion
//
// KSPowerAssertion.h
// Sandvox
//
// Created by Mike on 04/08/2012.
// Copyright (c) 2012 Karelia Software. All rights reserved.
//
#import <Foundation/Foundation.h>
#import <IOKit/pwr_mgt/IOPMLib.h>