Skip to content

Instantly share code, notes, and snippets.

View syuilo's full-sized avatar
🥺

syuilo syuilo

🥺
  • Earth
  • 13:46 (UTC +09:00)
View GitHub Profile
@pacochi
pacochi / mastodon_misskey_pudding.user.js
Last active July 19, 2018 06:31
Mastodon で表示される⭐ボタンを misskey っぽいところからの投稿のみ🍮にします。
// ==UserScript==
// @name [Mastodon] This is not ⭐, but 🍮!
// @namespace hen.acho.co
// @include https://*/web/*
// @version 1.180415
// @description replace misskey's star button with pudding
// @downloadURL https://gist.github.com/pacochi/7a529cc0a344ba90e7b764f944e037e0/raw/mastodon_misskey_pudding.user.js
// @run-at document-idle
// @grant none
// ==/UserScript==

[JavaScript] オブジェクト, Map, WeakMap の使い分け方

概要

JavaScript で下記4点を連想配列として用いる場合の使い分け方を解説します。

  • オブジェクト初期化子
  • Object.create(null)
  • Map
  • WeakMap
@unarist
unarist / misskey-quick-reaction.user.js
Last active July 4, 2018 13:55
Misskey - Quick reaction
// ==UserScript==
// @name Misskey - Quick reaction
// @namespace https://github.com/unarist/
// @version 0.3.1
// @description Click existing reaction to cast same one
// @author unarist
// @match https://misskey.xyz/*
// @require https://cdn.jsdelivr.net/npm/js-cookie@2/src/js.cookie.min.js
// @downloadURL https://gist.github.com/unarist/3d99742d3bb2af5d500b494400996aca/raw/misskey-quick-reaction.user.js
// @grant none
@dmail
dmail / url.js
Last active January 5, 2024 11:09
URL parts naming. Inspired from web browsers API (new URL(), window.location) and rfc3986.
/*
href
┌────────────────────────────────────────┴──────────────────────────────────────────────┐
origin │
┌────────────┴──────────────┐ │
│ authority │
│ ┌───────────────┴───────────────────────────┐ │
│ │ host resource
│ │ ┌──────────┴─────────────────┐ ┌────────────┴───────────┬───────┐
│ │ hostname │ pathname │ │
@strothj
strothj / LICENSE
Last active March 30, 2024 11:35
ResizeObserver TypeScript definition
Copyright 2020 Jason Strothmann
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
@vielhuber
vielhuber / script.js
Last active June 16, 2022 16:28
on mousewheel vanilla js scroll horizontally #js
document.addEventListener('wheel', function(e)
{
if(e.type != 'wheel')
{
return;
}
let delta = ((e.deltaY || -e.wheelDelta || e.detail) >> 10) || 1;
delta = delta * (-300);
document.documentElement.scrollLeft -= delta;
// safari needs also this
@CodeMyUI
CodeMyUI / index.pug
Created October 30, 2017 10:12
Window to somewhere
.frame
.card
img.background-img(src="https://s3-us-west-2.amazonaws.com/s.cdpn.io/544318/hills.jpeg")
@think49
think49 / Webブラウザのウインドウのスクロール量を取得する.md
Last active October 4, 2021 03:29
Webブラウザのウインドウのスクロール量を取得する.md
@CodeMyUI
CodeMyUI / index.html
Created June 4, 2017 23:57
Input Focus Animation (SVG)
<div class="al"></div>
<div class="container">
<div class="header">Sign In</div>
<div class='info'>*Click on the input boxes</div>
<input id='username' class='text' onfocus="handle2()" class='inc2' type="text" name="Username" placeholder='Username' value="">
<!-- Had to remove the type "password" due to the browser user credential's autofill-->
<input id='password' class='pass' onfocus="handle1()" class='inc1' type="pass" name="Password" placeholder='Password' value="">
<button>Sign In</button>
<svg width="390" height="549" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
<rect id='rect' class='rect1' x="45px" y="300px" rx="27" ry="27" width="300px" height="50px" style="stroke: #fff; stroke-width: 1px; fill: #000" />

How To - Upload and add Images to markdown files in Gist

Markdown files allow embedding images in it. However it requires the image to be hosted at some location and we can add the url of the image to embed it.

Example: ![Alternate image text](https://someurl/imagelocation/image.png)

We can use services like imgur or other services to host the images and use the hosted URL.