Skip to content

Instantly share code, notes, and snippets.

View syuilo's full-sized avatar
🥺

syuilo syuilo

🥺
  • Earth
  • 21:29 (UTC +09:00)
View GitHub Profile
import System.Random (RandomGen, getStdGen, randoms)
import Control.Concurrent (threadDelay)
import System.Process (callCommand)
import Data.List.Split (chunksOf)
import Data.Maybe (fromMaybe)
type Cell = Bool
type CellTable = [[Cell]]
type Score = Int
type Pos = (Int, Int)
<script type="text/javascript">
function loadIframelyEmbedJs() {
// Replace 'iframe.ly' with your custom CDN if available.
if (document.querySelectorAll("[data-iframely-url]").length === 0
&& document.querySelectorAll("iframe[src*='iframe.ly']").length === 0) return;
var iframely = window.iframely = window.iframely || {};
if (iframely.load) {
iframely.load();
} else {
var ifs = document.createElement('script'); ifs.type = 'text/javascript'; ifs.async = true;
var p = console.log.bind(console);
var q = require('readline-sync').question;
var gcd = (a, b) => !b ? a : gcd(b, a % b);
var r = () => Math.floor(Math.random()*9)+1
var i = 1;
for(;;) {
var x = r();
var y = r();
var df = x % y === 0;
if(df) continue;
@voluntas
voluntas / webrtc.rst
Last active July 24, 2025 12:53
WebRTC コトハジメ
@paulirish
paulirish / what-forces-layout.md
Last active September 24, 2025 02:38
What forces layout/reflow. The comprehensive list.

What forces layout / reflow

All of the below properties or methods, when requested/called in JavaScript, will trigger the browser to synchronously calculate the style and layout*. This is also called reflow or layout thrashing, and is common performance bottleneck.

Generally, all APIs that synchronously provide layout metrics will trigger forced reflow / layout. Read on for additional cases and details.

Element APIs

Getting box metrics
  • elem.offsetLeft, elem.offsetTop, elem.offsetWidth, elem.offsetHeight, elem.offsetParent
@rinsuki
rinsuki / README.md
Last active October 29, 2019 06:49
Misskey API リファレンス(Unofficial)

#Misskey API リファレンス(Unofficial)

##最初に

このAPIリファレンスは非公式だし、書きかけです。
使用する際には自己責任でお願いします。
あとAPIがちゃんと使えるかどうかは確認してません。
Authorizeを除いてパラメータは必須と書いていない物以外はすべて任意です
##参考までに

@telekosmos
telekosmos / uniq.js
Last active November 15, 2022 17:13
Remove duplicates from js array (ES5/ES6)
var uniqueArray = function(arrArg) {
return arrArg.filter(function(elem, pos,arr) {
return arr.indexOf(elem) == pos;
});
};
var uniqEs6 = (arrArg) => {
return arrArg.filter((elem, pos, arr) => {
return arr.indexOf(elem) == pos;
});
@Integralist
Integralist / flatten-array.js
Created May 20, 2015 08:35
Array flatten function written in ES6 syntax
const flattenTco = ([first, ...rest], accumulator) =>
(first === undefined)
? accumulator
: (Array.isArray(first))
? flattenTco([...first, ...rest])
: flattenTco(rest, accumulator.concat(first))
const flatten = (n) => flattenTco(n, []);
console.log(flatten([[1,[2,[[3]]]],4,[5,[[[6]]]]]))
@laiso
laiso / gist:bf0037f61b6dae263749
Last active January 24, 2016 07:55
Fwd:【重要】.soドメインの取り扱いについて
━お名前.combyGMO━━━━━━━━━━━━━━━━━━━━━━━━
━━━━━━━━━━ドメイン公式登録サービス━━━━━━━━━━━━
━━━━━━━━━━━━━━━━━━━━━━http://www.onamae.com/━
平素は、お名前.comをご利用いただき、まことにありがとうございます。
属性型.soドメインを含む.soドメインについて、ソマリア政府の方針変更に
伴い上位機関及び上位機関での運用方針が変更されることが判明しました。
2015年7月8日に上位機関の変更が行われる予定となり、あわせてドメイン登録
方針が変更され、最終的にソマリア国内のみでの登録受付となる見通しです。
@FeodorFitsner
FeodorFitsner / install-redis.com
Created March 26, 2015 19:17
Installing and running Redis as a service
nuget install redis-64 -excludeversion
redis-64\redis-server.exe --service-install
redis-64\redis-server.exe --service-start