Skip to content

Instantly share code, notes, and snippets.

@ayapi
ayapi / index.md
Created April 27, 2022 10:14
WSLのArchがMicrosoft.NETCore.Appのバージョンエラーで起動できなくなったら
It was not possible to find any compatible framework version
The framework 'Microsoft.NETCore.App', version '5.0.0' (x64) was not found.
  - The following frameworks were found:
    6.0.2 at [/usr/share/dotnet/shared/Microsoft.NETCore.App]

て言ゎれたら

@ayapi
ayapi / comment.md
Created October 20, 2017 03:41
Promise説明

この関数が呼び出されると、処理が完了するたびにPromiseオブジェクトが返されます。

Promiseオブジェクトが返るのゎ処理が完了してからでゎなくて、すぐに返ります

体感できるょーにするために、execMkdirの非同期処理を仮のものに書き換ぇて、 処理めっちゃ遅ぃゃっをシミュレートしてみます

// promiseTest.js
@ayapi
ayapi / completion.js
Created October 17, 2016 10:43
completion (doesnt work yet)
"use strict";
const chevrotain = require('chevrotain');
const Lexer = chevrotain.Lexer;
const Parser = chevrotain.Parser;
const extendToken = chevrotain.extendToken;
const KEYWORD = extendToken('KEYWORD', Lexer.NA);
const PRIVATE = extendToken('PRIVATE', /Private/i, KEYWORD);
const PUBLIC = extendToken('PUBLIC', /Public/i, KEYWORD);
@ayapi
ayapi / refresh-viewport-height-demo.html
Last active July 19, 2022 10:34
minimum example xterm.js refresh-viewport-height
<!doctype html>
<html>
<head>
<title>xterm.js demo</title>
<link rel="stylesheet" href="../src/xterm.css" />
<script src="../src/xterm.js" ></script>
<script src="../addons/fit/fit.js" ></script>
<style>
#term-box {
overflow: hidden;
@ayapi
ayapi / gulpfile.js
Last active August 29, 2015 14:07
gulp task for `nw-gyp` to all dependencies recursively
// usage
// just
// `gulp nw-gyp`
// or type node-webkit version
// `gulp nw-gyp --target 0.9.2`
var gulp = require('gulp');
var exec = require('gulp-exec');
var minimist = require('minimist');
@ayapi
ayapi / chart.js
Last active August 29, 2015 14:07
_.throttle()の用途
// クライアントサイドの、まじてきとうなサンプルだょ
var util = require('util');
var EventEmitter = util.EventEmitter;
var _ = require('lodash');
var io = require('socket.io-client');
function Chart(socket, max_length){
this.ticks = [];
@ayapi
ayapi / gulpfile.js
Created June 26, 2014 02:21
gulp-svg2png + gulp-newer + gulp-imagemin + pngquant
var gulp = require('gulp');
var newer = require('gulp-newer');
var svg2png = require('gulp-svg2png');
var imagemin = require('gulp-imagemin');
var pngquant = require('imagemin-pngquant');
var path = {
svg2png : {
src : 'svg/*.svg',
dest : 'img'
@ayapi
ayapi / gulpfile.js
Created June 11, 2014 11:10
Webix Skin Builder with Gulp
var gulp = require('gulp');
var download = require('gulp-download');
var unzip = require('gulp-unzip');
gulp.task('webix', function(){
return download('http://webix.com/skin-builder/data/aec0da36.zip')
.pipe(unzip())
.pipe(gulp.dest('./dist/lib/webix/codebase/'))
});
@ayapi
ayapi / gulpfile.js
Created May 23, 2014 02:47
gulp-stylus + autoprefixer-stylus
var gulp = require('gulp');
var stylus = require('gulp-stylus');
var autoprefixer = require('autoprefixer-stylus');
gulp.task('stylus', function () {
return gulp.src('./styl/style.styl')
.pipe(stylus({
use: [autoprefixer('iOS >= 7', 'last 1 Chrome version')]
}))
.pipe(gulp.dest('./css'))
@ayapi
ayapi / gulpfile.js
Last active August 29, 2015 14:01
gulp-stylusでinline-image()
//gulp-stylus@1.0.0ばん
var gulp = require('gulp');
var stylus = require('gulp-stylus');
gulp.task('stylus', function () {
return gulp.src('./styl/style.styl')
.pipe(stylus({
url: {
//name:'url'とするとぜんぶのurl()がbase64埋め込みになる