Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

View sharapeco's full-sized avatar
💭
Tengo hambre

Shinichiro Yabu sharapeco

💭
Tengo hambre
View GitHub Profile
@sharapeco
sharapeco / gulpfile.js
Created February 28, 2019 07:18
Build React-Redux written in TSX with Gulp
// Gulp utilities
const {src, dest, watch, series, parallel} = require("gulp");
const source = require("vinyl-source-stream");
const buffer = require("vinyl-buffer");
const streamify = require("gulp-streamify");
const rename = require("gulp-rename");
const sourcemaps = require("gulp-sourcemaps");
// Error handling
const plumber = require('gulp-plumber');
@sharapeco
sharapeco / zen2han.vba
Created September 5, 2018 08:43
Excel で全角-半角変換
Sub Zen2han()
Dim num As Integer
Dim cells As Range
Set cells = ActiveSheet.cells.SpecialCells(xlCellTypeConstants, xlTextValues)
For num = 0 To 9
cells.Replace What:=Right(StrConv(Str(num), vbWide), 1), Replacement:=Right(Str(num), 1)
Next
cells.Replace What:="-", Replacement:="-"
End Sub
@sharapeco
sharapeco / doyonoushi.md
Last active September 5, 2018 08:39
土用の丑の日に食べるものリスト

土用の丑の日に食べるものリスト

2015-07-14

哺乳綱

  • ウシ
  • ウサギ
  • ウマ
@sharapeco
sharapeco / fitBoundsPerfectly.js
Created September 5, 2018 08:33
Google Maps API fitBoundsPerfectly
// 2014-12-16
google.maps.Map.prototype.fitBoundsPerfectly = function fitBoundsPerfectly(aBounds) {
var mapBounds, mapSW, mapNE, mapDLat, mapDLng, aSW, aNE, dLat, dLng, ratio, dZoom;
mapBounds = this.getBounds();
mapSW = mapBounds.getSouthWest();
mapNE = mapBounds.getNorthEast();
mapDLat = mapNE.lat() - mapSW.lat();
mapDLng = mapNE.lng() - mapSW.lng();
@sharapeco
sharapeco / cmyk_jpeg.md
Created September 5, 2018 08:14
CMYK JPEG 表示できない

2013-10-10

対応しているブラウザ

  • Explorer 10
  • Firefox 3, 24
  • Opera 9, 17
  • Chrome 30
  • Opera mobile

対応していないブラウザ

@sharapeco
sharapeco / yank-select.l
Created September 3, 2018 07:38
yank-select: xyzzy のキルリングをポップアップで選択する (from 須田さんち)
;; いろいろ
;; https://web.archive.org/web/20040817084508/http://member.nifty.ne.jp:80/seiya-suda/utilities.html
(defvar *yank-select-popup-menu* nil)
(setq *yank-select-popup-menu* (create-popup-menu nil))
(defun yank-select ()
(interactive)
(while (get-menu-position *yank-select-popup-menu* 'yank-select)
(delete-menu *yank-select-popup-menu* 'yank-select))
(continue-pre-selection)
@sharapeco
sharapeco / register-irfanview64.reg
Created July 24, 2018 05:27
Register IrfanView (64 bit) as a photo viewer on Windows 10
Windows Registry Editor Version 5.00
[HKEY_CLASSES_ROOT\Applications\i_view64.exe]
@=""
[HKEY_CLASSES_ROOT\Applications\i_view64.exe\DefaultIcon]
@="C:\\Apps\\IrfanView\\i_view64.exe,0"
[HKEY_CLASSES_ROOT\Applications\i_view64.exe\shell]
<?php
/*
メールをディスクに保存する
Based on rudiedirkx/mailtodisk.php
https://gist.github.com/rudiedirkx/ae893b4041aadda70d42
[php.ini]
sendmail_path = "C:\Server\php72nts\php.exe C:\Server\mailtodisk.php \"C:\Server\var\mailoutput\__TIME__-__RAND__-__SUBJECT__.eml\""
sendmail_path = "/usr/bin/php /var/www/mailtodisk.php \"/var/www/mailoutput/__TIME__-__RAND__-__SUBJECT__.eml\""
@sharapeco
sharapeco / pbcopy.js
Created July 6, 2018 06:04
pbcopy.js
function pbcopy(s,d,e,l,a){
d=document;a="appendChild";e=d.createElement("div");e[a](d.createElement("pre")).textContent=s;
l=e.style;l.position="fixed";l.left="-100%";d.body[a](e);d.getSelection().selectAllChildren(e);
l=d.execCommand("copy");d.body.removeChild(e);return l}
@sharapeco
sharapeco / jquery-cbcopy.js
Last active June 19, 2018 01:26
ブラウザに表示中の文字列をクリップボードにコピーする(jQueryを使用した実装)
/*
ブラウザに表示中の文字列をクリップボードにコピーする(jQueryを使用した実装)
jQuery + Bootstrap (v3) を使用している場合にすぐ動くコード。
次のようにマークアップすると、そのすぐあとにコピーするためのボタンが生成される。
<span class="js-cbcopy">コピーしたい文字列</span>
*/
$(function() {
function CBCopy(E) {