Skip to content

Instantly share code, notes, and snippets.

💭
Tengo hambre

sempre harapeco sharapeco

💭
Tengo hambre
Block or report user

Report or block sharapeco

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@sharapeco
sharapeco / fix-oswald.py
Created Sep 18, 2019
Google Fonts からダウンロードした Oswald-*.ttf の variant が全部 Regular になっているので修正する
View fix-oswald.py
## Google Fonts からダウンロードした Oswald-*.ttf の variant が全部 Regular になっているので修正する
##
## Requires:
## pip install fonttools
import sys
from fontTools.ttLib import TTFont
weights = [
@sharapeco
sharapeco / bing-bg-url.jpg
Created Mar 26, 2019
Bing の背景画像の URL を取得する
View bing-bg-url.jpg
location.protocol + "//" + location.host + document.getElementById("bgDiv").style.backgroundImage.replace(/^url\("?|"?\)$/g, "")
@sharapeco
sharapeco / gulpfile.js
Created Feb 28, 2019
Build React-Redux written in TSX with Gulp
View gulpfile.js
// 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 Sep 5, 2018
Excel で全角-半角変換
View zen2han.vba
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 Sep 5, 2018
土用の丑の日に食べるものリスト
View doyonoushi.md

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

2015-07-14

哺乳綱

  • ウシ
  • ウサギ
  • ウマ
@sharapeco
sharapeco / fitBoundsPerfectly.js
Created Sep 5, 2018
Google Maps API fitBoundsPerfectly
View fitBoundsPerfectly.js
// 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 Sep 5, 2018
CMYK JPEG 表示できない
View cmyk_jpeg.md

2013-10-10

対応しているブラウザ

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

対応していないブラウザ

@sharapeco
sharapeco / yank-select.l
Created Sep 3, 2018
yank-select: xyzzy のキルリングをポップアップで選択する (from 須田さんち)
View yank-select.l
;; いろいろ
;; 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 / download_test.php
Last active Aug 27, 2018
Content-Disposition: attachment で日本語ファイル名をダウンロードさせるテスト
View download_test.php
<?php
$t = isset($_GET['t']) ? $_GET['t'] : null;
$org = '此のファイル test.php';
$fn = array(
'A: UTF-8 Raw' => 'Content-Disposition: attachment; filename="' . $org . '"',
'B: UTF-8 URL Encoded' => 'Content-Disposition: attachment; filename="' . rawurlencode($org) . '"',
'C: UTF-8 Base64 Encoded' => 'Content-Disposition: attachment; filename="=?utf-8?B?' . base64_encode($org). '?="',
'D: RFC 2231' => 'Content-Disposition: attachment; filename*=UTF-8\'\'' . rawurlencode($org),
@sharapeco
sharapeco / register-irfanview64.reg
Created Jul 24, 2018
Register IrfanView (64 bit) as a photo viewer on Windows 10
View register-irfanview64.reg
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]
You can’t perform that action at this time.