Skip to content

Instantly share code, notes, and snippets.

@vimyum
vimyum / index.js
Created May 2, 2018 15:59
Plugin Example of Hyper
styles = {
img : {
zIndex: 20,
position: "absolute",
bottom: "0em",
right: "1em",
},
baloon : {
zIndex: 30,
position: "absolute",
@vimyum
vimyum / markdown.js
Last active December 8, 2020 10:47
extended markdown plugin for Reveal.js
/**
* The reveal.js markdown plugin. Handles parsing of
* markdown inside of presentations as well as loading
* of external markdown documents.
*/
(function( root, factory ) {
if (typeof define === 'function' && define.amd) {
root.marked = require( './marked' );
root.RevealMarkdown = factory( root.marked );
root.RevealMarkdown.initialize();
@vimyum
vimyum / app.spec.ts
Created December 15, 2017 16:02
Jestサンプルのテスト対象
// (1): モックを定義 (1)
const mockFileData = `test\n is\n spec.`;
jest.mock('fs', () => {
return {
readFileSync: jest.fn(() => mockFileData),
readFile: jest.fn((path, opt, cb) => {
cb(null, mockFileData);
});
};
});
@vimyum
vimyum / tmuxSend.vim
Created October 26, 2017 13:01
send sentence from vim to below tmux pane.
function! SendBottomV() range
let l:selected = getline(a:firstline, a:lastline)
let result = system("tmux send -t bottom \"". join(l:selected,'\n') ."\n\" 2>&1 | cat")
endfunction
function! SendBottom()
let result = system("tmux send -t bottom \"". getline(".") ."\n\" 2>&1 | cat")
endfunction
function! ClearBottom()
const express = require('express');
const app = express();
const axios = require('axios');
const successMsg = { status: 200, message: 'success' };
const POWER_ON = 100;
const POWER_OFF = 0;
const RETRY_NUM = 10;
// レポーターブロックで返す値
@vimyum
vimyum / spotlight.js
Created September 6, 2017 14:48
SpotLight JSS
ar toggle = false;
$('.searchlight')
.on('mousemove', function(event) {
$(this).addClass('on').css({'margin-left': event.pageX -150, 'margin-top': event.pageY -150});
})
.on('mouseout', function(event) {
$(this).removeClass('on');
})
.on('click', function() {
if (toggle) {