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
(function(win){ | |
// Simple JavaScript Templating | |
// John Resig - https://johnresig.com/ - MIT Licensed | |
// https://johnresig.com/blog/javascript-micro-templating/ | |
// | |
// There are some minor modification done by me. | |
var cache = {}; | |
function tmpl(str, data){ | |
var fn; |
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
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 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 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 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 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 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
/** | |
* Signup function that uses AWS Cognito SDK. It wraps its API into a promise | |
* to consume it easily from other parts of the app. | |
*/ | |
function signUp(email, password) { | |
var attributes = [new CognitoUserAttribute({ | |
Name: 'email', | |
Value: email, | |
})] | |
return new Promise(function(resolve, reject) { |
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
function Welcome() { | |
return ( | |
<div> | |
Welcome {keycloak.idTokenParsed.name}! | |
<button onClick={() => keycloak.accountManagement()}> | |
Account | |
</button> | |
<button onClick={() => keycloak.logout()}> | |
Logout | |
</button> |
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 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 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 ( |
NewerOlder