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 wrapStyle = `display: flex; justify-content: center; padding: 2rem 1.5rem; font-size: 1.4rem; color: #fff; background: rgba(0, 0, 0, 0.7); border-radius: 1.6rem; position: fixed; top: 50%; left: 50%; z-index: var(--dxm-toast-z-index); transform: translate3d(-50%, -50%, 1px);`; | |
const contentStyle = `display: flex; flex-direction: column; align-items: center; text-align: center;`; | |
const simpleToast = { | |
info: (content, duration = 2) => { | |
if (window.simpleToastTimer) { | |
clearTimeout(window.simpleToastTimer); | |
} | |
const toastEleId = '__simple_toast'; |
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
{"lastUpload":"2021-04-14T09:43:11.829Z","extensionVersion":"v3.4.3"} |
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 | |
# replace name of html entry with fixed "index.html" in cmd file | |
targetCmdPath="${PWD}/{{ slug }}.sketchplugin/Contents/Sketch/my-command.js" | |
sed -i -r -E "s/(_webpack_resources\/).+(\.html)/\1index\2/" "$targetCmdPath" | |
# copy index.html to _webpack_resources | |
htmlPath="${PWD}/src/dist/index.html" | |
webpackResourcePath="${PWD}/{{ slug }}.sketchplugin/Contents/Resources/_webpack_resources" | |
/bin/cp -f "$htmlPath" "$webpackResourcePath" |
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 { ipcMain as ipc, BrowserWindow } from 'electron' | |
// 向渲染进程发送消息 | |
export function send(channel, ...args) { | |
const currentWindow = BrowserWindow.getFocusedWindow() | |
return new Promise((resolve) => { | |
if (currentWindow) { | |
currentWindow.webContents.send(channel, ...args) | |
ipc.once(`${channel}`, (event, count, ...res) => { | |
resolve({ event, payload: res.length === 1 ? res[0] : res }) |
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 { ipcRenderer as ipc } from 'electron' | |
let ipcCount = 0 | |
// 向主进程发送消息,并等待主进程的回复 | |
export function send(channel, ...args) { | |
const localCount = ipcCount += 1 | |
return new Promise((resolve) => { | |
ipc.once(`${channel}-${ipcCount}`, (event, ...res) => { | |
resolve({ event, payload: res.length === 1 ? res[0] : res }) |
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
% A Prolog program to find people's lover | |
% -------------------------------- | |
man(george). man(jack). man(tony). | |
woman(lucy). woman(fiona). woman(peggy). | |
% % A man can only fall in love with one woman | |
% % Women are already in different rooms and they like to eat different foods | |
uniq(A, B, C) :- woman(A), woman(B), woman(C), \+A=B, \+A=C, \+B=C. |
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
-- Copyright (c) 2015-present, Facebook, Inc. | |
-- All rights reserved. | |
-- | |
-- This source code is licensed under the BSD-style license found in the | |
-- LICENSE file in the root directory of this source tree. An additional grant | |
-- of patent rights can be found in the PATENTS file in the same directory. | |
on run argv | |
set theURL to item 1 of argv | |
tell application "Chrome" |
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
{ | |
"name": "React-awesome", | |
"version": "0.0.1", | |
"description": "react awesome project", | |
"author": "superRaytin@163.com", | |
"contributors": [], | |
"repository": "http://github.com/superRaytin/React-awesome", | |
"dependencies": { | |
"react": "^0.13.3", | |
"keymirror": "^0.1.1" |