Skip to content

Instantly share code, notes, and snippets.

View 3846masa's full-sized avatar

Masahiro Miyashiro (3846masa) 3846masa

View GitHub Profile
class LowPassFilter {
constructor(alpha) {
this.setAlpha(alpha);
this.y = null;
this.s = null;
}
setAlpha(alpha) {
if (alpha <= 0 || alpha > 1.0) {
throw new Error();
@3846masa
3846masa / !readme.md
Last active August 16, 2022 14:55
#vscode Visual Studio Codeのmarkdownでmathjaxを使えるようにするパッチ(仮)

Visual Studio Codeのmarkdownでmathjaxを使えるようにするパッチ(仮)

無保証

導入方法

  • markdownWorker.js にパッチを当てる
    • WindowsではC:\Users\{USER}\AppData\Local\Code\app-0.1.0\resources\app\client\vs\languages\markdown
    • パッチを当てる前に,js-beautifyで整形してください
@3846masa
3846masa / gist:6218a252ea5b75385552
Created October 20, 2014 05:54
if文の中が1行のとき,どれがベストなのか
/*
if文の中が1行のとき,どれがベストなのか
コメント募集(下記以外の方法でも可)
*/
// 01
if (true) println("true");
// 02
if (true)
#!/usr/bin/python
import tweepy
# ログイン設定
twitter_conf = {
'consumer' : {
'key' : "consumer_key",
'secret' : "consumer_secret"
},
<%
var position = (config.position || '')[0] || 'tb';
delete config.position;
-%>
\begin{figure}[<%= position %>]
\centering
\includegraphics[<%= utils.stringify(config) %>]{<%= url %>}
<% if (caption) { -%>
\caption{<%= caption.replace(/\n/g, '\\protect\\\\%\n') %>}<%= label %>
<% } -%>

Keybase proof

I hereby claim:

  • I am 3846masa on github.
  • I am 3846masa (https://keybase.io/3846masa) on keybase.
  • I have a public key whose fingerprint is 827D 460E F1F7 A2C6 D043 AFB4 0B80 0405 FDDA 4B34

To claim this, I am signing this object:

pre>code{display:block;overflow-x:auto;padding:0.5em;color:#333 !important;background:#f8f8f8 !important;}
@3846masa
3846masa / hsp_mosaic.hsp
Created May 16, 2017 05:10
HSP でモザイクする例
#module
#deffunc mosaic int _x1, int _y1, int _x2, int _y2, int _level
_w = _x2 - _x1 : _h = _y2 - _y1
_csel = ginfo_sel : _cx = ginfo_cx : _cy = ginfo_cy
_bw = (_w / _level) | 0x01 : _bh = (_h / _level) | 0x01
buffer 99, _bw, _bh, 0
pos 0, 0
gzoom _bw, _bh, _csel, _x1, _y1, _w, _h, 0
gsel _csel, 0
@3846masa
3846masa / docker-compose.yml
Created March 5, 2017 05:06
NX DNS switch hack
# https://github.com/obi12341/docker-unbound
unbound:
image: secns/unbound:1.6.0
ports:
- "53:53/udp"
- "53:53"
environment:
- DO_IPV6=yes
- DO_IPV4=yes
- DO_UDP=yes
@3846masa
3846masa / index.js
Created September 10, 2016 04:29
requirebin sketch
// Welcome! require() some modules from npm (like you were using browserify)
// and then hit Run Code to run your code on the right side.
// Modules get downloaded from browserify-cdn and bundled in your browser.
const emojione = require('emojione');
const emojiRegExp = emojione.unicodeRegexp;
console.log(emojiRegExp);
console.log("\uD83C\uDF63".match(emojiRegExp));