Skip to content

Instantly share code, notes, and snippets.

View armspkt's full-sized avatar
🧸

armspkt

🧸
  • Bangkok, Thailand
View GitHub Profile
@armspkt
armspkt / what-forces-layout.md
Created July 18, 2022 09:56 — forked from paulirish/what-forces-layout.md
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
@armspkt
armspkt / Code.gs
Last active February 9, 2025 15:44
Google Apps Script Code
function getAccesstoken() { Logger.log(ScriptApp.getOAuthToken()) } // DriveApp.getFiles()
function doGet(e) {
getAccesstoken()
const result = {
status: 'ok'
}
return ContentService.createTextOutput(JSON.stringify(result)).setMimeType(ContentService.MimeType.JSON);
}
@armspkt
armspkt / curl.txt
Created May 11, 2021 18:51
line notify curl
curl --location --request POST 'https://notify-api.line.me/api/notify' \
--header 'Content-Type: application/x-www-form-urlencoded' \
--header 'Authorization: Bearer xxx' \
--data-urlencode 'message=ทดสอบยิงจาก Postman ฮับบ'
@armspkt
armspkt / index.js
Last active September 22, 2021 16:15
line bot webhook
const express = require("express");
const line = require("@line/bot-sdk");
const axios = require("axios");
const qs = require("qs");
const config = {
channelAccessToken: "xxx", // add your channel access token
channelSecret: "xxx", // add your channel secret
};
@armspkt
armspkt / index.html
Created January 28, 2021 13:09
Netflix Intro Animation Pure CSS
<div id="container">
<!-- Edit the letter attr to: N, E, T, F, L, I or X -->
<netflixintro letter="N">
<div class="helper-1">
<div class="effect-brush">
<span class="fur-31"></span>
<span class="fur-30"></span>
<span class="fur-29"></span>
<span class="fur-28"></span>
<span class="fur-27"></span>
-- code for https://youtu.be/tp_5c6jaNQE
create table users (
id serial primary key,
first_name varchar(255) not null,
last_name text,
age int,
email text unique not null
);

Problem

I have two Github accounts: oanhnn (personal) and superman (for work). I want to use both accounts on same computer (without typing password everytime, when doing git push or pull).

Solution

Use ssh keys and define host aliases in ssh config file (each alias for an account).

How to?

  1. Generate ssh key pairs for accounts and add them to GitHub accounts.
@armspkt
armspkt / cloudSettings
Last active August 13, 2019 04:11
test
{"lastUpload":"2019-08-13T04:11:46.042Z","extensionVersion":"v3.4.1"}