View whoisryosuke-v1.osm.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"$schema": "https://raw.githubusercontent.com/JanDeDobbeleer/oh-my-posh/main/themes/schema.json", | |
"blocks": [ | |
{ | |
"alignment": "left", | |
"segments": [ | |
{ | |
"background": "#ffffff", | |
"foreground": "#000000", | |
"leading_diamond": "", |
View index.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<div id="output" style="background:green;min-height:40px"> | |
</div> |
View useKeyPress.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { useEffect, useState } from "react" | |
// Modified the useKeyPress from useHooks: https://usehooks.com/useKeyPress/ | |
// Takes a `pressMethod` that will run continuously "every frame" (1/60 second - not locked tho) | |
// And also accepts a `downMethod` and `upMethod` for a single call | |
// And still returns a simple true/false for the keypress for convenience/use in React | |
// Ideally all the methods should be an properties of 1 object so user doesn't have to set noop functions to get deeper params | |
export default function useKeyPress(targetKey: string, pressMethod?: () => void, downMethod?: () => void, upMethod?: () => void): boolean { | |
// State for keeping track of whether key is pressed | |
const [keyPressed, setKeyPressed] = useState(false) |
View platform-check.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var OSName = "Unknown"; | |
if (window.navigator.userAgent.indexOf("Windows NT 10.0")!= -1) OSName="Windows 10"; | |
if (window.navigator.userAgent.indexOf("Windows NT 6.3") != -1) OSName="Windows 8.1"; | |
if (window.navigator.userAgent.indexOf("Windows NT 6.2") != -1) OSName="Windows 8"; | |
if (window.navigator.userAgent.indexOf("Windows NT 6.1") != -1) OSName="Windows 7"; | |
if (window.navigator.userAgent.indexOf("Windows NT 6.0") != -1) OSName="Windows Vista"; | |
if (window.navigator.userAgent.indexOf("Windows NT 5.1") != -1) OSName="Windows XP"; | |
if (window.navigator.userAgent.indexOf("Windows NT 5.0") != -1) OSName="Windows 2000"; | |
if (window.navigator.userAgent.indexOf("Mac") != -1) OSName="Mac/iOS"; | |
if (window.navigator.userAgent.indexOf("X11") != -1) OSName="UNIX"; |
View index.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<title>Dialog Example</title> | |
</head> | |
<body> | |
<h1>Dialog Example</h1> | |
<button id="execute-dialog">Click to show dialog</button> |
View fetch-post-request.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(async () => { | |
const rawResponse = await fetch('https://httpbin.org/post', { | |
method: 'POST', | |
headers: { | |
'Accept': 'application/json', | |
'Content-Type': 'application/json' | |
}, | |
body: JSON.stringify({a: 1, b: 'Textual content'}) | |
}); | |
const content = await rawResponse.json(); |
View gist:3c482e593dee25e2b9d52f0f850b91ba
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1) Open known_hosts file and look for the invalid host | |
nano ~/.ssh/known_hosts | |
2) Remove the line that has the invalid host. Should be the same host in your .git/config of your repo | |
ssh-keygen -R [dev.blahblah.com]:1234 | |
3) Pull from repo | |
git pull | |
4) You should see something similar to this. Answer 'yes' when asked. |
View MouseLook.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System.Collections; | |
using System.Collections.Generic; | |
using UnityEngine; | |
public class MouseLook : MonoBehaviour | |
{ | |
private bool mouseLock = true; | |
public float mouseSensitivity = 100f; | |
public Transform playerBody; |
View PointerExample.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using UnityEngine; | |
using UnityEngine.EventSystems; // 1 | |
public class PointerExample : MonoBehaviour | |
, IPointerClickHandler // 2 | |
, IDragHandler | |
, IPointerEnterHandler | |
, IPointerExitHandler | |
// ... And many more available! | |
{ |
View CheckClicks.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System.Collections.Generic; | |
using UnityEngine; | |
using UnityEngine.UI; | |
using UnityEngine.EventSystems; | |
public class CheckClicks : MonoBehaviour | |
{ | |
// Normal raycasts do not work on UI elements, they require a special kind | |
GraphicRaycaster raycaster; |
NewerOlder