Skip to content

Instantly share code, notes, and snippets.

View sttk's full-sized avatar

Takayuki Sato sttk

  • self-employed
  • Saitama, Japan
View GitHub Profile
@sttk
sttk / java-named-parameters.md
Last active March 20, 2024 13:56
Java named parameters

Java named parameters

By using Consumer like functional interface.

The sample code is as follows:

package mypackage;

import static mypackage.MyData.NamedParam.*;
@sttk
sttk / checks-for-plain-objects.md
Created March 11, 2021 13:01
Checks for plain objects

(Node.js v0.11〜)

               typeof=o       protoToStr     proto=ObjProto proto=null     ctor=Obj       ctor=null      protoCtor=Obj  protoCtor=null 
-- strict plain object --
(1)            true           true           true           false          true           false          true           false          
(2)            true           true           true           false          true           false          true           false          
(3)            true           true           true           false          true           false          true           false          
-- wider plain object --
(4)            true           true           false          true           false          false          false          false          
@sttk
sttk / differences-of-isplainobject.md
Last active March 11, 2021 12:27
The differences of behaviors of `isPlainObject`

The differences of behaviors of isPlainObject

(Node.js v0.11〜)

          PObject   PObj      lodash    @fav      
(1)       true      true      true      true      
(2)       true      true      true      true      
(3)       true      true      true      true      
(4)       true      true      true      true      
(5)       true      false     false     false     
@sttk
sttk / javascript-prototype-pollution.md
Last active April 7, 2023 15:13
Javascript Prototype Pollution

Javascript Prototype Pollution

Javascript prototype specification

// Not only Object but also other types. (Function, Array, String, Number, ...)
Object.prototype.prop1 = 1;
Object.prototype.func1 = () => 'Hello!';                                        

const obj1 = {};
@sttk
sttk / ColoringConfigFormat.md
Last active January 7, 2018 12:32
gulp-cli coloring
{
  colors: {
    helpUsageTitle: 'title'
    helpUsageSyntax: '',
    helpUsageOption: 'option',
    helpUsageTask: 'task',
    helpOptionsTitle: '',
    helpOptionsName: '',
 helpOptionsAlias: '',
@sttk
sttk / window-open.md
Created June 7, 2017 14:09
Window open

Window Opening

A memo about opening a window of Web browsers.

API of window.open

var win = window.open(url, target, features)
@sttk
sttk / windowSize.html
Last active May 10, 2023 21:27
Window size
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8"/>
<title>Window Size</title>
<style>
html { font-size: 12px; }
div.fixed { position: fixed; left: calc(100% - 100px); top: 20px; }
div.fixed > a { font-size: 14px; }
</style>
@sttk
sttk / windowScrollSize.html
Last active March 31, 2017 12:37
Window Scroll Size
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8"/>
<title>Window Scroll Size</title>
<style>
html { font-size: 12px; margin: 1px; padding: 2px; border: solid 3px red; }
body { margin: 4px; padding: 6px; }
body { width: 2000px; height: 2000px; }
body { border: solid 6px blue; }
@sttk
sttk / windowScrollPosition.html
Last active March 31, 2017 12:39
Window Scroll Position
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8"/>
<style>
html { font-size: 12px; }
div.background-view { width: 1000px; height: 1000px; }
div.print-area { position: fixed; top: 10px; left: 10px; padding: 10px; }
</style>
</head>
@sttk
sttk / windowPropsUsages.md
Created March 30, 2017 20:39
Window Properties Usages

Window Properties Usages

In the specification about Window object [CSSOM View Module], the following properties related to window position and size are specified:

  • innerWidth
  • innerHeight
  • scrollX
  • scrollY
  • pageXOffset