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
| declare module "dbus-native" { | |
| import * as net from "net"; | |
| import * as events from "events"; | |
| interface msg{ | |
| destination?:string ; | |
| path?:string ; | |
| 'interface'?:any ; | |
| member:string ; | |
| signature?:any; |
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 fs from 'fs'; | |
| import { EventEmitter } from 'events'; | |
| const speedTest = require('speedtest-net'); | |
| var wrap = (callback: Function) => { | |
| try { | |
| callback(); | |
| } catch (error) { | |
| console.log(error); | |
| } |
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 Stomp from 'stompjs'; | |
| export class STOMPService { | |
| public state: STOMPState; | |
| public messages: Stomp.Message; | |
| private config: StompConfig; | |
| private client: Stomp.Client; | |
| private resolvePromise: { (...args: any[]): void }; | |
| private connectCallBack: (mes: Stomp.Message) => any; |
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 Stomp from 'webstomp-client'; | |
| import * as WebSocket from 'ws' | |
| export class STOMP { | |
| public state: STOMPState; | |
| public messages: Stomp.Message; | |
| private _config: StompConfig; | |
| private _client: Stomp.Client; | |
| private _resolvePromise: { (...args: any[]): void }; | |
| private _connectCallBack: (mes: Stomp.Message) => any; |
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
Show hidden characters
| { | |
| "compileOnSave": false, | |
| "buildOnSave": false, | |
| "compilerOptions": { | |
| "module": "commonjs", | |
| "target": "es6", | |
| "noImplicitAny": false, | |
| "sourceMap": false, | |
| "outDir": "./dist/", | |
| "typeRoots": [ |
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
| // from parent javascript would be | |
| window.addEventListener('message', function(event){ | |
| // event handle | |
| console.log(event) | |
| }) | |
| // use button click to send event 'test' could be anything | |
| function send(){ | |
| let iframe = window.frames[0]; | |
| iframe.postMessage('test', document.querySelector('iframe').src); |
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 get(url, data, headers = []) { | |
| let formBody = !!data ? Object.keys(data).map(k => `${encodeURIComponent(k)}=${data[k]}`).join('&') : ''; | |
| let getUrl = formBody.length ? `${url}?${formBody}` : url; | |
| let header = new Headers({ | |
| 'Accept': 'application/json', | |
| 'Content-Type': 'application/x-www-form-urlencoded' | |
| }) | |
| headers.map(ele => { | |
| const { name, value } = ele | |
| if (name && value) |
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
| #!/bin/bash | |
| sudo apt-get update | |
| sudo apt-get install -y \ | |
| apt-transport-https \ | |
| ca-certificates \ | |
| curl \ | |
| software-properties-common | |
| curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add - | |
| sudo apt-key fingerprint 0EBFCD88 |
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
| FROM ubuntu:12.04 | |
| RUN apt-get update | |
| RUN apt-get upgrade -y | |
| RUN apt-get install -y build-essential && \ | |
| apt-get install -y python-software-properties software-properties-common && \ | |
| apt-get install -y byobu curl git htop man unzip vim wget pkg-config libdbus-1-dev && \ | |
| add-apt-repository -y ppa:ubuntu-toolchain-r/test && \ | |
| apt-get update && \ | |
| apt-get install -y gcc-4.9 g++-4.9 && \ |
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
| " Fisa-vim-config | |
| " http://fisadev.github.io/fisa-vim-config/ | |
| " version: 8.3.1 | |
| " ============================================================================ | |
| " Vim-plug initialization | |
| " Avoid modify this section, unless you are very sure of what you are doing | |
| let vim_plug_just_installed = 0 | |
| let vim_plug_path = expand('~/.vim/autoload/plug.vim') |
OlderNewer