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 * as cdk from '@aws-cdk/core'; | |
| import * as backup from '@aws-cdk/aws-backup'; | |
| import * as iam from '@aws-cdk/aws-iam'; | |
| import { tables } from './tables'; | |
| export class BackupStack extends cdk.Stack { | |
| constructor(scope: cdk.Construct, id: string, props?: cdk.StackProps) { | |
| super(scope, id, props); |
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
| const puppeteer = require('puppeteer'); | |
| const path = require('path'); | |
| const util = require('util'); | |
| const mkdirp = require('mkdirp'); | |
| const initMocha = require('./setup'); | |
| const DEVICE_PROFILE = { | |
| viewport: { | |
| width: 1280, | |
| height: 400, |
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 peco-select-history() { | |
| local tac | |
| if which tac > /dev/null; then | |
| tac="tac" | |
| else | |
| tac="tail -r" | |
| fi | |
| BUFFER=$(\history -n 1 | \ | |
| eval $tac | \ | |
| peco --query "$LBUFFER") |
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
| <ContentEditable | |
| onPaste={(e: React.ClipboardEvent<HTMLDivElement>) => { | |
| // Disable default behavior to prevent html tag pasted. | |
| e.preventDefault(); | |
| let pastedText = ""; | |
| // clipboard data on paste event (Cross browser) | |
| // See, also https://stackoverflow.com/questions/2176861/javascript-get-clipboard-data-on-paste-event-cross-browser | |
| if (window.clipboardData && window.clipboardData.getData) { | |
| pastedText = window.clipboardData.getData("Text"); | |
| } else if (e.clipboardData && e.clipboardData.getData) { |
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 addActionsType(fileName, { pascalName, importPath }) { | |
| const actionName = `${pascalName}Actions`; | |
| const content = fs.readFileSync(fileName, "utf-8"); | |
| const importPathLiteral = t.stringLiteral(`${importPath}`); | |
| importPathLiteral.raw = importPath; | |
| const targetIdentifier = t.identifier(actionName); | |
| const newImportDeclaration = t.importDeclaration( | |
| [t.importSpecifier(targetIdentifier, targetIdentifier)], | |
| importPathLiteral, | |
| ); |
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 pulse from './pulse.js'; | |
| export default class Oscillator { | |
| constructor(type) { | |
| try { | |
| const AudioContext = window.AudioContext || window.webkitAudioContext | |
| this.context = new AudioContext(); | |
| } catch (e) { | |
| throw new Error('Web Audio isn\'t supported in this browser!'); |
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
| mergeInto(LibraryManager.library, { | |
| start_oscillator: function (index) { | |
| Module.NES.oscs[index].start(); | |
| }, | |
| stop_oscillator: function (index) { | |
| Module.NES.oscs[index].stop(); | |
| }, | |
| close_oscillator: function (index) { | |
| Module.NES.oscs[index].close(); | |
| }, |
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
| const convertKeyCode = (keyCode) => { | |
| switch (keyCode) { | |
| case 88: return 0x01; // X A | |
| case 90: return 0x02; // Z B | |
| case 65: return 0x04; // A SELECT | |
| case 83: return 0x08; // S START | |
| case 38: return 0x10; // ↑ ↑ | |
| case 40: return 0x20; // ↓ ↓ | |
| case 37: return 0x40; // ← ← | |
| case 39: return 0x80; // → → |
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
| #[macro_use] | |
| extern crate lazy_static; | |
| extern crate libc; | |
| mod nes; | |
| mod externs; | |
| use nes::Context; | |
| fn main() {} |
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
| use std::cell::RefCell; | |
| use std::ptr::null_mut; | |
| use std::os::raw::{c_int, c_void}; | |
| #[allow(non_camel_case_types)] | |
| type em_callback_func = unsafe extern "C" fn(); | |
| thread_local!(static MAIN_LOOP_CALLBACK: RefCell<*mut c_void> = RefCell::new(null_mut())); | |
| extern "C" { |
NewerOlder