This file contains hidden or 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
window.title = "Hello!"; | |
window.visible = false; | |
const canvas = window.canvas; | |
const requestMonotonicAnimationFrame = (function () { | |
const fps = 60; | |
let start = 0; | |
const timestep = (function* () { | |
const step = 1000 / fps; |
This file contains hidden or 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
window.title = "Hello!"; | |
window.visible = true; | |
const monotonicDelta = createMonotonicFPSGenerator(60); | |
function requestMonotonicAnimationFrame(callback) { | |
callback(monotonicDelta.next().value); | |
} | |
const canvas = window.canvas; |
This file contains hidden or 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 React from "react" | |
import { redirect } from "remix" | |
import type { ActionFunction } from "remix" | |
export const action: ActionFunction = async ({ request }) => { | |
const token = "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" | |
const body = new URLSearchParams(await request.text()) | |
const fileName = body.get("fileName") as string | |
const content = body.get("content") |
This file contains hidden or 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
# Fix locale error | |
# Put this into /etc/environment | |
LC_ALL=en_US.UTF-8 | |
LANG=en_US.UTF-8 | |
# SSH agent | |
eval `ssh-agent -s` | |
# Add a key to the keychain | |
ssh-add ~/.ssh/id_rsa |
This file contains hidden or 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
function Welcome() { | |
return ( | |
<div> | |
Welcome {keycloak.idTokenParsed.name}! | |
<button onClick={() => keycloak.accountManagement()}> | |
Account | |
</button> | |
<button onClick={() => keycloak.logout()}> | |
Logout | |
</button> |
This file contains hidden or 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 React from 'react'; | |
import Keycloak from './Keycloak.js'; | |
import { keycloak } from '../modules/keycloak.js'; | |
function Welcome() { | |
return ( | |
<div> | |
Welcome {keycloak.idTokenParsed.name}! | |
<button onClick={() => keycloak.accountManagement()}> | |
Account |
This file contains hidden or 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 React from 'react'; | |
import Keycloak from './Keycloak.js'; | |
import { keycloak } from '../modules/keycloak.js'; | |
function Welcome() { | |
return <div>Welcome {keycloak.idTokenParsed.name}!</div> | |
} | |
function App() { | |
return ( |
This file contains hidden or 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 React from 'react'; | |
function App() { | |
return ( | |
<Keycloak> | |
<div>Welcome!</div> | |
</Keycloak> | |
); | |
} |
This file contains hidden or 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 React, {useState, useEffect} from 'react'; | |
import keycloak from '../modules/keycloak.js'; | |
function Keycloak({children}) { | |
// We'll use this variable to halt the app | |
// excecution until the user is Authenticated | |
const [isAuthenticated, setIsAuthenticated] = useState(false); | |
// The `init()` method we'll be in charge of starting | |
// the authentication flow. | |
useEffect(() => { |
This file contains hidden or 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 React from 'react'; | |
import ReactDOM from 'react-dom'; | |
import App from './components/App.js'; | |
import { init } from './modules/keycloak.js'; | |
// Initialize the Keycloak client | |
init(); | |
// Render the React application | |
ReactDOM.render(<App />, document.getElementById('root')); |
NewerOlder