Skip to content

Instantly share code, notes, and snippets.

View petamoriken's full-sized avatar
🌐
Proceeding with the Web

Kenta Moriuchi petamoriken

🌐
Proceeding with the Web
View GitHub Profile
@repeatedly
repeatedly / d_master.md
Last active November 14, 2024 06:49
D言語基礎文法最速マスター

他の言語をある程度知っている人はこれを読めばD言語の基礎をマスターでき,D言語の氷山の一角くらいは知ることができると思います.対象バージョンはdmd 2.059です.

1. 基礎

ソースファイル

ASCIIかUTFしか受け付けません.それ以外の文字コードで書くとコンパイルエラーになります.

main

D言語のmainはCとは違い以下のようなシグネチャです.

@ryboe
ryboe / bad_css
Last active August 14, 2024 15:01
Non-standard and Obsolete CSS Properties
OBSOLETE PREFIXES
-xv-interpret-as // -xv- and -o- are old Opera prefixes for the Presto
-xv-phonemes // engine. Opera switched to the Blink engine with
-xv-voice-balance // version 15. The current version is 34.
-xv-voice-duration
-xv-voice-pitch
-xv-voice-pitch-range
-xv-voice-rate
-xv-voice-stress
-xv-voice-volume
@preco21
preco21 / InlineWorker.js
Last active May 25, 2016 01:03
Simple InlineWorker
import Promise from 'bluebird';
import EventEmitter from 'eventemitter3';
class InlineWorker {
constructor(source) {
if (typeof source != 'function') {
throw new TypeError('source must be a function');
}
if (this._worker) {
@yurydelendik
yurydelendik / !wasmllvm.md
Last active September 15, 2024 09:15
Using WebAssembly in LLVM

NOTE: the content is out-of-date. All development is moved to the https://github.com/yurydelendik/wasmception

Using WebAssembly in LLVM

Compiling

# locations, e.g.
export WORKDIR=~/llvmwasm; mkdir -p $WORKDIR
export INSTALLDIR=$WORKDIR
@gaogao-9
gaogao-9 / 00_usage.js
Last active October 31, 2015 20:24
Array.prototypeをSymbolで汚染する夢が見たかった…(gao_functional.jsが、3つのファイルをconcatしたソースコードです) 現状Firefoxのみ動作可能です
var _ = GaoFunctional();
var input = "114514";
var res = input[_.count]();
console.log(res); // 6
var input2 = [1,1,4,5,1,4];
var res2 = input2[_.count]((x)=>x===1);
console.log(res2); // 3
@nikhan
nikhan / twitter.sh
Created January 1, 2016 04:45
twitter ffmpeg
ffmpeg -i test.mov -vcodec libx264 -vf 'scale=640:trunc(ow/a/2)*2' -acodec aac -vb 1024k -minrate 1024k -maxrate 1024k -bufsize 1024k -ar 44100 -strict experimental -r 30 out.mp4
class HtmlSpecialChars{
constructor(list){
if(typeof(list) === "undefined") return;
this.escapeList = list;
}
set escapeList(value){
if(typeof(value) !== "object"){
throw new TypeError("escapeListはObject型のプロパティです");
@gaogao-9
gaogao-9 / Promise.js
Last active October 30, 2021 19:18
正しいPromise.reverseとPromise.anyの実装例
Promise.reverse = function reverse(promise){
// 範囲を広げるために、一応instanceof Promiseではなく、thenableを通すようにしてる。
switch(true){
case (typeof(promise) !== "object"):
case (promise === null):
case (typeof(promise.then) !== "function"):
return Promise.reject(promise);
}
return promise.then((data)=> Promise.reject(data), (err)=> Promise.resolve(err));
@Rich-Harris
Rich-Harris / footgun.md
Last active October 8, 2024 15:14
Top-level `await` is a footgun

Edit — February 2019

This gist had a far larger impact than I imagined it would, and apparently people are still finding it, so a quick update:

  • TC39 is currently moving forward with a slightly different version of TLA, referred to as 'variant B', in which a module with TLA doesn't block sibling execution. This vastly reduces the danger of parallelizable work happening in serial and thereby delaying startup, which was the concern that motivated me to write this gist
  • In the wild, we're seeing (async main(){...}()) as a substitute for TLA. This completely eliminates the blocking problem (yay!) but it's less powerful, and harder to statically analyse (boo). In other words the lack of TLA is causing real problems
  • Therefore, a version of TLA that solves the original issue is a valuable addition to the language, and I'm in full support of the current proposal, which you can read here.

I'll leave the rest of this document unedited, for archaeological

@xl1
xl1 / gist:55aa630747d7eb4fa97361baa80bab63
Last active November 27, 2019 04:28
<img> で EXIF の回転情報を考慮して表示したい

<img> で EXIF の回転情報を考慮して表示したい

環境

Windows 10

  • Chrome 55
  • Firefox 50
  • IE 11
  • Edge EdgeHTML 14