This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package nu.mine.kino; | |
import java.text.ParseException; | |
import com.nimbusds.jose.JOSEException; | |
import com.nimbusds.jose.JWSAlgorithm; | |
import com.nimbusds.jose.JWSHeader; | |
import com.nimbusds.jose.JWSObject; | |
import com.nimbusds.jose.JWSVerifier; | |
import com.nimbusds.jose.KeyLengthException; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@Data | |
@AllArgsConstructor | |
public class AccessTokenRequestParam { | |
private String redirect_url; | |
private String client_id; | |
private String client_secret; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package nu.mine.kino; | |
import java.security.InvalidKeyException; | |
import java.security.NoSuchAlgorithmException; | |
import javax.crypto.Mac; | |
import javax.crypto.SecretKey; | |
import javax.crypto.spec.SecretKeySpec; | |
import org.apache.commons.codec.binary.Base64; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
\left( | |
\begin{array}{c} | |
\cos\theta\\ | |
\sin\theta | |
\end{array} | |
\right) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package nu.mine.kino.springboot; | |
/* | |
* Copyright 2012-2016 the original author or authors. | |
* | |
* Licensed under the Apache License, Version 2.0 (the "License"); | |
* you may not use this file except in compliance with the License. | |
* You may obtain a copy of the License at | |
* | |
* http://www.apache.org/licenses/LICENSE-2.0 | |
* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import * as functions from 'firebase-functions' | |
import * as cookie from 'cookie' | |
// // Start writing Firebase Functions | |
// // https://firebase.google.com/docs/functions/typescript | |
// | |
export const addCookie = functions.https.onRequest((request, response) => { | |
response.setHeader('Cache-Control', 'private') // Hosting経由だと、これがないとset cookieが削除される | |
_addCookie(response, 'key', 'value') | |
response.send('Hello from Firebase!') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
clientId=xxx | |
clientSecret=xxx | |
login_hint=1001 | |
user_code=675325 | |
backchannelReq=`cat << EOS | |
curl http://localhost:8080/api/backchannel/authentication -X POST \ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"AWSTemplateFormatVersion": "2010-09-09", | |
"Parameters": { | |
"VpcId": { | |
"Type": "AWS::EC2::VPC::Id", | |
"Description": "VpcId of your existing Virtual Private Cloud (VPC)" | |
}, | |
"SubnetId": { | |
"Type": "AWS::EC2::Subnet::Id", | |
"Description": "SubnetId of your existing Subnet" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const request = require('request') | |
const url = 'https://rss.techplay.jp/event/w3c-rss-format/rss.xml' | |
request(url, function(error, response, body) { | |
if (!error && response.statusCode == 200) { | |
console.log(body) | |
const regex = /[\b]/ | |
body = body.replace(regex) | |
const json = xml2json(body) | |
// for (var i in json.rss.channel.item) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const moment = require('moment-timezone') | |
// シンプルに | |
console.log(moment().format()) // 2020-02-13T10:47:10+09:00 (いま日本で10:47です) | |
console.log(new Date().toLocaleString()) // 2020-2-13 10:50:22 AM | |
// ってやると本番に行くと値が9時間ずれるよね、みたいな件。。 | |
// 日付をあつかうには | |
// どのタイムゾーンの日付か(Timezone) | |
// どの言語で表示するか(Locale) |
OlderNewer