Skip to content

Instantly share code, notes, and snippets.

View Masatoshi's full-sized avatar

Masatoshi Ishida Masatoshi

  • Kaizu Denki Co.,Ltd.
  • Aichi / Japan
View GitHub Profile
@Masatoshi
Masatoshi / cuid.sql
Created July 26, 2023 05:37 — forked from srfrog/cuid.sql
CUIDs for PL/PgSQL
-- Collision-resistant ids optimized for horizontal scaling and performance, for PL/PgSQL.
-- Based on https://github.com/ericelliott/cuid
-- Version 1.0.0
-- Usage: SELECT cuid();
-- BEGIN CONFIG ---
-- Put a unique host ID (int) here per server instance.
-- Once set, this value should not be changed.

Using Google APIs with OAuth2 101

npmのgoogleapisパッケージを利用します。 https://github.com/googleapis/google-api-nodejs-client

const { google } = require('googleapis');

 authの利用

googleapisパッケージのauthは、いくつかの認証方法を提供してくれます。

@Masatoshi
Masatoshi / gas_ss_atena.js
Created February 15, 2019 08:28 — forked from tamx/gas_ss_atena.js
Googleスプレッドシート_宛名印刷
// 宛名印刷&住所録 テスト用データ
/*
1000001 ◯◯県◯◯市◯◯◯◯◯,1丁目2−3 ◯山 ◯太郎 様,◯子 様 2000001 ◯◯県◯◯市◯◯ 1丁目2−3,◯◯アパート◯◯◯号室 ◯村 ◯郎
1000002 ◯◯◯県◯◯◯市◯◯◯,2丁目3−4 ◯木 ◯男 様 2000001 ◯◯県◯◯市◯◯ 1丁目2−3,◯◯アパート◯◯◯号室 ◯村 ◯郎
1000003 ◯◯県◯◯◯郡◯◯◯◯,3丁目4−5 ◯村 ◯一  様,◯◯美 様 2000001 ◯◯県◯◯市◯◯ 1丁目2−3,◯◯アパート◯◯◯号室 ◯村 ◯郎
*/
// はがきのシートの設定
function setHagakiSheet(){
var margin_left = 1; // 左側の余白
@Masatoshi
Masatoshi / vscode-latex.md
Created July 25, 2018 04:30 — forked from Ikuyadeu/vscode-latex.md
VSCode でLatexの日本語環境を作る

https://marketplace.visualstudio.com/items?itemName=James-Yu.latex-workshop に書いてあったbibのコンパイルを日本語に対応.

  1. VSCodeやLatexをインストールしてなければインストール(https://code.visualstudio.com/)
  2. Latex-Workshopをインストール(https://marketplace.visualstudio.com/items?itemName=James-Yu.latex-workshop)
  3. settings.json(Windows: ファイル > 基本設定 > 設定, Mac: Code > 基本設定 > 設定)の[ ]の間に以下を追加
    "latex-workshop.latex.tools": [
        {
            "command": "ptex2pdf",
            "args": [
@Masatoshi
Masatoshi / datasources.json
Created December 25, 2015 02:27 — forked from clarkbw/datasources.json
Google Time Zone API datasource for Strongloop Loopback
"google": {
"name": "google",
"debug": true,
"connector": "rest",
"operations": [
{
"template": {
"doc": "The Google Time Zone API",
"method": "GET",
"url": "https://maps.googleapis.com/maps/api/timezone/{format=json}",
@Masatoshi
Masatoshi / 20140826.md
Created November 7, 2015 01:46 — forked from nulltask/20140826.md
Express / Socket.IO をスケールアウトしてみよう
@Masatoshi
Masatoshi / Admin-LTE-Angular.js
Created September 29, 2015 04:49 — forked from carlcraig/Admin-LTE-Angular.js
Admin-LTE-Angular
(function () {
'use strict';
angular
.module('admin-lte', [])
.directive('adminLteLayout', adminLteLayoutDirective)
.directive('adminLteTree', adminLteTreeDirective)
.directive('adminLteSidebarToggle', adminLteSidebarToggleDirective)
.directive('adminLteSidebarToggleSwipe', adminLteSidebarToggleSwipeDirective)
.directive('adminLteBoxWidget', adminLteBoxWidgetDirective);

Setting up RhodeCode on Ubuntu Server 12.04

Goal

  • Everything running on a single Ubuntu Server
  • RhodeCode running in a virtualenv
  • Use SQLite as the database
// preserve Twitter's style of JSON string encoding...
// escape higher value unicode (lowercase hex)
// escape < and > (uppercase hex)
// escape / in strings (\/)
// hugs! https://gist.github.com/1306986
// http://stackoverflow.com/questions/4901133/json-and-escaping-characters
function escapedStringify(s, emit_unicode) {
var json = JSON.stringify(s);
return emit_unicode ? json : json.replace(/\//g,
function(c) {
@Masatoshi
Masatoshi / ngx_http_autoindex_module.c
Created October 23, 2012 05:07 — forked from sterlingwes/ngx_http_autoindex_module.c
Nginx Module: Autoindex in JSON Format
/*
* Copyright (C) Igor Sysoev
* Copyright (C) Nginx, Inc.
* Borrowed from: Zed A. Shaw
* Background: http://serverfault.com/questions/123529/how-can-i-get-json-from-nginx-autoindex
*/
#include <ngx_config.h>