Skip to content

Instantly share code, notes, and snippets.

View subak's full-sized avatar

Subak Systems subak

  • Subak Systems
  • Japan
View GitHub Profile
@norami
norami / merge.ts
Last active May 14, 2021 16:22
なるべく古いオブジェクトを残しつつ、新しいオブジェクトをコピーしたものを返す
const merge = (oldValue: any, newValue: any) => {
if (oldValue === newValue) {
return oldValue;
}
if (typeof oldValue !== "object" || typeof newValue !== "object") {
return newValue;
}
const createdObj: any = {};
let changed = false;
for (const key of Object.keys(oldValue)) {
@azu
azu / TypeScriptの設定の良し悪し.md
Last active June 27, 2024 06:48
TypeScriptの設定の良し悪し

tsconfig.json の設定についてのメモ書きです。

Node.jsのバージョンごとの設定

target は 変換後のコードのECMAScriptバージョンを指定する たとえば、Node.js 14はES2020をサポートしている。そのため、Node.js 14向けのコード(サーバなど)ならtarget: "ES2020"を指定することで、余計なTranspileが省かれててコードサイズや実行時間が最適化される。

@FreddieOliveira
FreddieOliveira / docker.md
Last active July 17, 2024 01:42
This tutorial shows how to run docker natively on Android, without VMs and chroot.

Docker on Android 🐋📱

Edit 🎉

All packages, except for Tini have been added to termux-root. To install them, simply pkg install root-repo && pkg install docker. This will install the whole docker suite, left only Tini to be compiled manually.


Summary

@jdeathe
jdeathe / cloud-config-docker-el7.yml
Last active April 6, 2021 13:29
Cloud-Init user-data to install Docker on CentOS-7
#cloud-config
---
timezone: "UTC"
write_files:
- path: "/etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-7"
permissions: "0644"
owner: "root:root"
content: |
-----BEGIN PGP PUBLIC KEY BLOCK-----
@voluntas
voluntas / safari_webrtc.rst
Last active May 12, 2019 08:01
Safari の WebRTC 対応について

WIP某所で喋るための草稿。

Testable JavaScript

当たり前のことを書く。当たり前のことが、当たり前にできない人へ。JavaScriptだから、当たり前のことをしなくていいと思っている人達へ。

基本方針

  • それぞれのファイルは、可能な限り参照透過な関数を提供する
  • それぞれのファイルは、読み込んだだけでは副作用を起こさない
@lwrage
lwrage / highlighting-kate.html
Created January 27, 2017 19:11
highlighting-kate vs. skylighting
<head><title>highlighttest.aadl</title><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><meta name="generator" content="highlight-kate"><style type="text/css">div.sourceCode { overflow-x: auto; }
table.sourceCode, tr.sourceCode, td.lineNumbers, td.sourceCode {
margin: 0; padding: 0; vertical-align: baseline; border: none; }
table.sourceCode { width: 100%; line-height: 100%; }
td.lineNumbers { text-align: right; padding-right: 4px; padding-left: 4px; color: #aaaaaa; border-right: 1px solid #aaaaaa; }
td.sourceCode { padding-left: 5px; }
code > span.kw { color: #007020; font-weight: bold; } /* Keyword */
code > span.dt { color: #902000; } /* DataType */
code > span.dv { color: #40a070; } /* DecVal */
code > span.bn { color: #40a070; } /* BaseN */
@dtolb
dtolb / jssip.md
Last active December 15, 2023 10:46
JsSip Demo

JSSIP with Catapult API

⚠️ This has been updated at JsFiddle*

Prerequisites

  • Register for a Catapult (Bandwidth Application Platform) account here
  • Register a SIP domain
  • Create an endpoint/user
  • If you want to make calls to the PSTN (normal phones) you will need a server to handler events from Catapult
@kumatti1
kumatti1 / hoge.cpp
Last active April 29, 2019 09:02
メモ帳のウィンドウ制御
#include <stdio.h>
#include <windows.h>
void hoge()
{
HWND hwnd = FindWindowW( L"Notepad", L"無題 - メモ帳");
if(!hwnd){
MessageBoxW(0, L"", L"メモ帳未起動!", MB_OK);
_wsystem(L"c:\\windows\\system32\\notepad.exe");
@atsu666
atsu666 / gist:bdcf6197fa21ac534e8c
Created October 30, 2015 03:11
a-blog cmsのキャッシュ処理周り
//-------
// cache
define('ZIP_USE', !DEBUG_MODE and !!ZIP_ENABLE and ('on' == config('zip_http')));
if ( 1
and !DEBUG_MODE
and ('on' == config('cache'))
and (!SID or (config('subscriber_cache') === 'on' and ACMS_RAM::userAuth(SUID) === 'subscriber' and !$Q->get('admin')))
and !(is_ajax() and config('ajax_nocache') === 'on' and $GetQuery->get('nocache') === 'yes')
and !HTTPS
and !ACMS_POST