Skip to content

Instantly share code, notes, and snippets.

View laiso's full-sized avatar
☀️

laiso laiso

☀️
View GitHub Profile
FROM php:fpm-alpine
RUN set -eux && \
apk update && \
apk add dpkg && \
curl -L https://download.newrelic.com/php_agent/release/newrelic-php5-9.2.0.247-linux-musl.tar.gz | tar -C /tmp -zx && \
NR_INSTALL_USE_CP_NOT_LN=1 NR_INSTALL_SILENT=1 /tmp/newrelic-php5-*/newrelic-install install
# + curl -L https://download.newrelic.com/php_agent/release/newrelic-php5-9.2.0.247-linux-musl.tar.gz
@laiso
laiso / CodePiece.js
Created May 15, 2019 16:42
サーバーレスレスアーキテクチャでFirebase Authでログインさせる時はuidそのまま送ると実装によっては置き換え攻撃ができてしまう! https://firebase.google.com/docs/auth/admin/verify-id-tokens?hl=ja #CodePiece
signInSuccessWithAuthResult: (authResult, redirectUrl) => {
authResult.user
.getIdToken(false)
.then(idToken => {
// idToken をサーバーへ送ってdecodeしてuserを取り出す!!!!
});
return false;
}
@laiso
laiso / CodePiece.scala
Created April 26, 2019 06:18
英会話学習用のテキストを自作したくてQuoraのクスレイピングを書いた。なぜScalaなのかは不明…… #CodePiece
import java.io.{File, PrintWriter}
import org.jsoup.Jsoup
import scalaj.http.BaseHttp
object Main extends App {
def dumpToFile(text: String) = {
val writer = new PrintWriter(new File("dump.md"))
writer.write(text)
}
@laiso
laiso / Podfile
Created March 12, 2019 12:17
Firebase/Firestore iOS v0.16 系と FirebaseIn/AppMessaging を共存させる
pod 'Firebase'
pod 'FirebaseCore', '~> 5.1.0'
pod 'FirebaseFirestore', '~> 0.16.1'
pod 'FirebaseInAppMessagingDisplay'
pod 'FirebaseInAppMessaging', '~> 0.12.1'
@laiso
laiso / TOX.txt
Last active March 10, 2019 06:57
Pythonによるデータ分析入門, O'Reilly Japan 目次 https://www.oreilly.co.jp/books/
1章 はじめに
1.1 この本で説明する内容
1.1.1 どういうデータを扱うのか
1.2 なぜPythonをデータ分析に使うのか
1.2.1 「糊(グルー)」としてのPython
1.2.2 「2つの言語」問題を解決する
1.2.3 Pythonを使うべきではないケース
1.3 必須のPythonライブラリ
1.3.1 NumPy
1.3.2 pandas
@laiso
laiso / firestore-batch.js
Created December 14, 2018 06:15
chunk loading
const query = firestore
.collection(`posts`)
.limit(200)
forEachDocs(query, docs => {
docs.map(doc => {
console.log(`${doc.id} do something`)
})
})
@laiso
laiso / mail.txt
Created November 22, 2018 17:52
React Native Developer - The Internet of the Future
---------- Forwarded message ---------
From: Martin Raeburn <[email protected]>
Date: Thu, Nov 22, 2018 at 10:39 PM
Subject: React Native Developer - The Internet of the Future
To: [email protected] <[email protected]>
Dear laiso,
@laiso
laiso / Notification.test.js
Created October 10, 2018 13:36
Jest testing with mock of Cloud Firestore SDK
const admin = require('firebase-admin')
class Notification {
constructor(doc, firestore = admin.firestore()) {
this.doc = doc
this.firestore = firestore
}
notify(toUser) {
const {user} = this.doc.data()
//
// GoogleDocsViewController.swift
// Created by laiso on 2018/06/12.
//
// let gdViewController = GoogleDocsViewController(nibName: nil, bundle: nil)
// gdViewController.url = "https://docs.google.com/document/.../pub"
// let nav = UINavigationController(rootViewController: gdViewController)
// self.present(nav, animated: true, completion: nil)
//
いつもGMOコインをご利用いただき、誠にありがとうございます。
当社では現在、すべてのアルトコインについてスプレッドを縮小するキャンペーンを実施させていただいておりますが、12月上旬以降のアルトコイン価格高騰に伴い、当初2017年12月27日(水) 15:00終了を予定していた本キャンペーンにつきまして、
「2017年12月22日(金) 10:00終了」
とさせていただきます。
※当社のスプレッドは、変動制であり、相場状況等により変動する場合がございます。
お客様には直前のご案内となり、大変ご不便をおかけいたしますが、ご了承いただけますよう何卒お願い申し上げます。