Skip to content

Instantly share code, notes, and snippets.

View max-berman's full-sized avatar

Max Berman max-berman

View GitHub Profile

Phaser 3 Cheatsheet

This is the content from the original Phaser cheatsheet, the site of which went down. I'm editing outdated information as I come across it.

Starting a new game

All config is optional, but width, height and scene is recommended to add.

var  config = {
@finxter
finxter / structArray2.sol
Created December 28, 2021 08:28 — forked from yassesh/structArray2.sol
Created using remix-ide: Realtime Ethereum Contract Compiler and Runtime. Load this file by pasting this gists URL or ID at https://remix.ethereum.org/#version=soljson-v0.8.7+commit.e28d00a7.js&optimize=false&runs=200&gist=
pragma solidity ^0.8.0;
pragma experimental ABIEncoderV2;
contract SavingsAccount {
struct Member{
uint id;
string name;
uint balance;
}
mapping (uint => Member) public members;
event savingsEvent(uint indexed _memberId);
// JSON API --- https://hexdailystats.com/fulldata
// JSON API --- https://hexdailystats.com/livedata
// https://codeakk.medium.com/hex-development-data-a1b1822446fa
// https://togosh.medium.com/hex-developer-guide-3b018a943a55
// NOTE: New rows of historical full data usually get added into database about 20 minutes after 00:00:00 UTC every day
// NOTE: Live data updates every 1 minute
// TEST: Copy and run code with online javascript compiler --- https://jsfiddle.net/
@stefanovazzocell
stefanovazzocell / xps15fingerprint.sh
Created November 19, 2020 00:55
Ubuntu / PopOS Fingerprint Support - Dell XPS 15 9500
#!/usr/bin/env bash
echo 'Adding Dell repository...'
# https://www.dell.com/community/XPS/XPS-13-9300-Does-fingerprint-reader-work-on-linux/td-p/7514958
sudo sh -c 'cat > /etc/apt/sources.list.d/focal-dell.list << EOF
deb http://dell.archive.canonical.com/updates/ focal-dell public
# deb-src http://dell.archive.canonical.com/updates/ focal-dell public
deb http://dell.archive.canonical.com/updates/ focal-oem public
# deb-src http://dell.archive.canonical.com/updates/ focal-oem public
@mapster
mapster / Readme.md
Last active December 30, 2023 06:29
Export Google Authenticator secret OTP-keys

Export Google Authenticator secret OTP-keys

I recently got myself a Yubikey and wanted to set up the Yubico Authenticator with all the OTPs I had in Google Authenticator. Unfortunately Yubico Authenticator doesn't support scanning the QR-code that the Google Authenticator generates when you export the OTP-keys, and it seemed like quite the daunting task to log in to every service to generate new OTP-keys. So I decided to have a look at the contents of the QR code, to see if I could import the keys into Yubico Authenticator in one go. Luckily I found a blog post by Alex Bakker that describes the data format.

Transfer QR-code to computer

Unfortunately, but likely for the best, the security policy of Google Authenticator won't allow you to take a screenshot of

@tajnymag
tajnymag / tinder.user.js
Last active July 7, 2024 15:03
Tinder Deblur Userscript (ARCHIVED and DEPRECATED, see https://github.com/tajnymag/tinder-deblur)
// ==UserScript==
// @name Tinder Deblur
// @namespace Violentmonkey Scripts
// @match https://tinder.com/*
// @grant none
// @version 1.4
// @author Tajnymag
// @downloadURL https://raw.githubusercontent.com/tajnymag/tinder-deblur/main/tinder.user.js
// @description Simple script using the official Tinder API to get clean photos of the users who liked you
// ==/UserScript==
@Danziger
Danziger / interval.hook.ts
Last active November 15, 2023 18:00
✨ Declarative useTimeout (setTimeout), useInterval (setInterval) and useThrottledCallback (useCallback combined with setTimeout) hooks for React (in Typescript)
import React, { useEffect, useRef } from 'react';
/**
* Use setInterval with Hooks in a declarative way.
*
* @see https://stackoverflow.com/a/59274004/3723993
* @see https://overreacted.io/making-setinterval-declarative-with-react-hooks/
*/
export function useInterval(
callback: React.EffectCallback,
function makeSoup() {
const pot = boilPot();
chopCarrots();
chopOnions();
await pot;
addCarrots();
await letPotKeepBoiling(5);
addOnions();
await letPotKeepBoiling(10);
console.log("Your vegetable soup is ready!");
const MyComponent = props => {
const innerFunction = useCallback(() => {
// do something!
});
useEffect(() => {
innerFunction();
// The effect calls innerFunction, hence it should declare it as a dependency
// Otherwise, if something about innerFunction changes (e.g. the data it uses), the effect would run the outdated version of innerFunction
}, [innerFunction]);
@simrat39
simrat39 / pop_install.md
Last active February 3, 2024 06:51
Photoshop CC 2018 on Pop!_OS/Ubuntu Installation Guide

Photoshop CC 2018 on Pop!_OS installation guide

1 . Install Wine

Enable 32 bit architecture:

sudo dpkg --add-architecture i386