Skip to content

Instantly share code, notes, and snippets.

View 1000ch's full-sized avatar
howdy

Shogo Sensui 1000ch

howdy
View GitHub Profile

Keybase proof

I hereby claim:

  • I am 1000ch on github.
  • I am 1000ch (https://keybase.io/1000ch) on keybase.
  • I have a public key ASD84tTuyL3MKx4vZB2nWNS50etyuOj1DccgB4XcZPhD8Ao

To claim this, I am signing this object:

@1000ch
1000ch / cost-of-buying-an-apartment.md
Last active October 12, 2020 10:16
マンションの購入時・居住時にかかる費用
@1000ch
1000ch / hideUntilYesterday.gs
Last active March 1, 2021 13:50
Google Apps Script to hide columns which include the date until yesterday.
function hideUntilYesterday() {
const spreadSheetId = 'spreadSheetId';
const spreadSheet = SpreadsheetApp.openById(spreadSheetId);
const yesterdayTime = Date.now() - (24 * 60 * 60 * 1000);
for (const sheet of spreadSheet.getSheets()) {
const lastColumn = sheet.getLastColumn();
let column = 2;
while (column <= lastColumn) {
{const style = document.createElement('style');style.innerHTML = `* { background-color: rgba(255,0,0,.2); }* * { background-color: rgba(0,255,0,.2); }* * * { background-color: rgba(0,0,255,.2); }* * * * { background-color: rgba(255,0,255,.2); }* * * * * { background-color: rgba(0,255,255,.2); }* * * * * * { background-color: rgba(255,255,0,.2); }* * * * * * * { background-color: rgba(255,0,0,.2); }* * * * * * * * { background-color: rgba(0,255,0,.2); }* * * * * * * * * { background-color: rgba(0,0,255,.2); }`;document.head.appendChild(style);}

HTML/CSS Coding Guideline

コーディングガイド by @mdoから多くを抜粋・改変しています。

HTML について

  • 半角スペース2個のソフトタブを使用する
  • 行末の空白を自動消去する
  • 文字エンコーディングをUTF-8にする
  • 新しい行を最後に追加する
@1000ch
1000ch / pre-commit.sh
Last active October 25, 2016 06:38 — forked from arnaud-lb/pre-commit.sh
pre-commit git hook for crushing images
#!/bin/sh
# to use, save this file as .git/hooks/pre-commit in your git repo
# make sure to add execute permissions using: chmod +x .git/hooks/pre-commit
command -v imgo >/dev/null 2>&1 || {
echo "\033[1mPlease install imgo to reduce images size before commit\033[0m"
echo "Install imgo with the following:"
echo "\t \033[1mnpm install -g imgo\033[0m"
exit 1;
}

By Saad Mousliki

御存知の通り、JavaScriptは数あるプログラミング言語のうちのひとつであり、モバイルのハイブリッドアプリ(PhoneGapやAppceleratorといった)や、サーバーサイド(NodeJSやWakanda)等の様々な所で実装されているWebの言語です。 また、Webブラウザにalertを出すところから、ロボットを動かす(nodebotやnodruinoを使って)ところまで様々なシーンで使われる言語となりました。 JavaScriptをマスターし、パフォーマンスの良いコードを生み出す開発者は市場で最も求められています。

@1000ch
1000ch / app.js
Last active December 3, 2019 02:07
WebRTC video chat with PeerJS.
(function(global) {
// Compatibility
navigator.getUserMedia = navigator.getUserMedia || navigator.webkitGetUserMedia;
var peerClient;
var currentPeerConnection;
var localMediaStream;
$(function() {

Syntax Highlight with Highlight

Install highlight

Install highlight with homebrew.

brew install highlight

Select theme

@1000ch
1000ch / selector.js
Last active December 16, 2015 21:39
const rx = {
id: /^#([\w\-]+)$/,
className: /^\.([\w\-]+)$/,
tagName: /^[\w\-]+$/,
name: /^\[name=["']?([\w\-]+)["']?\]$/
};
function $(selector, context) {
let result;
let m;