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
const { contextBridge, ipcRenderer } = require('electron'); | |
contextBridge.exposeInMainWorld('ipc', { | |
submit: (channel, ...data) => { | |
console.log('api send'); | |
const validChannels = ['toMain']; | |
if (validChannels.includes(channel)) { | |
ipcRenderer.send(channel, ...data); | |
} | |
}, |
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, { Component, createRef, useEffect, useState } from "react"; | |
import ReactDOM from 'react-dom'; | |
import PropTypes from 'prop-types'; | |
const Modal = (props) => { | |
// console.log(props); | |
const [show, setShow] = useState(false); |
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 function getAll () { | |
let cont = true; | |
let page = 1; | |
let ret = []; | |
while(cont) { | |
const moreShips = await fetch("https://swapi.dev/api/starships/?page="+page).then(r => r.json()); | |
if (!moreShips.next) cont = false; | |
page = page + 1; | |
ret = [...ret, moreShips]; | |
} |
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
/* This Source Code Form is subject to the terms of the Mozilla Public | |
* License, v. 2.0. If a copy of the MPL was not distributed with this | |
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */ | |
/* | |
* IMPORTANT NOTE | |
* This file is parsed in js (see client/shared/theme.js) | |
* so the formatting should be consistent (i.e. no '}' inside a rule). | |
*/ |
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
// ==UserScript== | |
// @name MDN anchor links | |
// @namespace http://tampermonkey.net/ | |
// @version 0.1 | |
// @description try to take over the world! | |
// @author You | |
// @match https://developer.mozilla.org/* | |
// @grant none | |
// ==/UserScript== |
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
let playersList = {}; | |
listeId.map((ident, i) => { | |
playersList[ident] = { | |
score : 0, | |
x : 0, | |
y : 0 | |
} | |
}) | |
const playersList = listeId.reduce( (p, c) => ({ ...p, [c]: { score: 0, x: 0 , y:0 } }), {}); |
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
#!/bin/sh | |
# | |
# /etc/network/if-up.d/custom-dyndns | |
# | |
# Update dynamic dns provider changeip.com. | |
# | |
# Create a link with: | |
# `sudo ln ~/.bin/changeipcom /etc/network/if-up.d/custom-dyndns` | |
# | |
# Save your sensitive data in /root/secrets: |
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
// ==UserScript== | |
// @name jsfiddle auto dark switch | |
// @namespace http://tampermonkey.net/ | |
// @version 0.1 | |
// @description try to take over the world! | |
// @author You | |
// @include https://jsfiddle.net/* | |
// @grant none | |
// ==/UserScript== |
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 { themeChange } from '../../../style/theme'; | |
... | |
themeChange.subscribe(console.log); // logs dark/light |
NewerOlder