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 { sep } from 'path'; | |
function splitPath(filename, level: number) { | |
const paths = filename.split(sep); | |
return paths.splice(paths.length - level).join(sep); | |
} | |
export function caller(level: number) { | |
const oldStackTrace = Error.prepareStackTrace; | |
try { |
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 TypedArrayToHeap(arr) { | |
const { name, BYTES_PER_ELEMENT } = arr.constructor; | |
const prefix = name.charAt(0).replace(/I|B/, ''); | |
const heap = Module[`HEAP${prefix}${BYTES_PER_ELEMENT << 3}`]; | |
if (!heap) { | |
throw new Error(`Unknow typed array ${heap}`); | |
} | |
const ptr = Module._malloc(arr.length * BYTES_PER_ELEMENT); | |
heap.set(arr, ptr / BYTES_PER_ELEMENT); |
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 io = require('socket.io-client'); | |
function main(address, message) { | |
const socket = io(address); | |
socket.on('connect', () => { | |
socket.emit('ppMessage', { messageId: message }); | |
socket.disconnect(); | |
}); | |
} |
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
{ | |
"recordMap": { | |
"block": { | |
"bc607894-081d-4905-9abf-fae6f9533a44": { | |
"role": "reader", | |
"value": { | |
"id": "bc607894-081d-4905-9abf-fae6f9533a44", | |
"version": 138, | |
"type": "page", | |
"properties": { |
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) 2010 devnight.net. All rights reserved. Use of this | |
* source code is governed by a MIT license that can be found in the | |
* LICENSE file. | |
--> | |
<!DOCTYPE html> | |
<html> | |
<meta http-equiv="Content-type" content="text/html; charset=utf-8"> | |
<head> | |
<script src="https://code.jquery.com/jquery-1.12.4.min.js"></script> |
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
''' | |
Shorten URL v1.5 | |
Github: https://github.com/hzlzh/Alfred-Workflows | |
Author: hzlzh (hzlzh.dev@gmail.com) | |
Twitter: @hzlzh | |
Blog: https://zlz.im/Alfred-Workflows/ | |
''' | |
# encoding: utf-8 |
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
.part.titlebar { | |
display: none !important; | |
} | |
.monaco-workbench { | |
background-color: rgba(0, 0, 0, 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
{ | |
"version": "0.2.0", | |
"configurations": [ | |
{ | |
"type": "node", | |
"request": "launch", | |
"name": "Electron: Main", | |
"protocol": "inspector", | |
"runtimeExecutable": "${workspaceRoot}/node_modules/.bin/electron", | |
"runtimeArgs": [ |
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 m = require('module') | |
const res = vm.runInThisContext(m.wrap(code))( | |
exports, | |
require, | |
module, | |
__filename, | |
__dirname | |
) |
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 log = console.log | |
console.log = function logIt() { | |
var stack = new Error().stack, | |
callee = stack.split('\n')[3].slice(7), | |
tag = '[LOG]'; | |
if (arguments.length > 0) { | |
tag = Array.prototype.slice.call(arguments, 0)[0] | |
} | |
log.call(this, tag, callee) | |
arguments.length > 1 && log.apply(this, arguments) |