Skip to content

Instantly share code, notes, and snippets.

@EITANINOMIYA
EITANINOMIYA / img_responsive_cover.html
Last active August 27, 2019 22:15
【レスポンシブ】imgタグをbackground:coverと同様の動きをさせる
/*#################################################
# imgタグをレスポンシブ
#################################################*/
<style>
.parent {
height:50vh; // 高さの指定は必要
position:relative;
overflow:hidden;
}
@EtienneR
EtienneR / user.js
Created January 7, 2016 23:39
XMLHttpRequest RESTful (GET, POST, PUT, DELETE)
// Get all users
var url = "http://localhost:8080/api/v1/users";
var xhr = new XMLHttpRequest()
xhr.open('GET', url, true)
xhr.onload = function () {
var users = JSON.parse(xhr.responseText);
if (xhr.readyState == 4 && xhr.status == "200") {
console.table(users);
} else {
console.error(users);
@Buravo46
Buravo46 / apache.md
Last active January 31, 2021 05:23
【XAMPP】バーチャルホストを設定し、同じLAN内の他PCからアクセスする方法

【XAMPP】バーチャルホストを設定し、同じLAN内の他PCからアクセスする方法

概要

同じLAN内の他PCやスマートフォンから、 ローカルで公開している画面にアクセスできるよう設定する方法です。

構築前の環境

@mumoshu
mumoshu / create-range.js
Last active December 18, 2019 01:28
選択範囲の文字列を取得するjs
// See: Introduction to Range
// http://www.quirksmode.org/dom/range_intro.html
var range = document.createRange();
// In which DOM node does the Range start or end?
range.setStart(selectionObject.anchorNode, selectionObject.anchorOffset);
// At which text offset does the Range start or end? The text offset is the position of the first or last character in the text node that's part of the Range.
range.setEnd(selectionObject.focusNode, selectionObject.focusOffset);