Skip to content

Instantly share code, notes, and snippets.

View ogawa0071's full-sized avatar

Futa Ogawa ogawa0071

View GitHub Profile
@ogawa0071
ogawa0071 / index.ts
Created August 15, 2020 08:27
steam-games-list
import axios from "axios";
// import papaparse from "papaparse";
import * as fs from "fs";
import retry from "async-retry";
// const startId = 32469;
// const startId = 15669;
// const startId = 450650;
// const startId = 445502;
// const startId = 432450;
@ogawa0071
ogawa0071 / index.ts
Created August 15, 2020 08:10
psp-games-list
import axios from "axios";
import * as fs from "fs";
const startIndex = 0;
(async () => {
// 0 Start
const index = 0;
// 1 Start
const size = 100;
@ogawa0071
ogawa0071 / index.js
Created May 19, 2020 12:36
Algolia Index Export
const algoliasearch = require("algoliasearch");
const client = algoliasearch("MKXB4H37FU", "");
const index = client.initIndex("game_index_production");
const fs = require("fs");
let hits = [];
index
@ogawa0071
ogawa0071 / index.ts
Created May 18, 2020 15:31
List all Google Cloud Storage files.
import fs from "fs";
import { Storage } from "@google-cloud/storage";
const storage = new Storage();
(async () => {
const files = await storage
.bucket("")
.getFilesStream();
@ogawa0071
ogawa0071 / followers.ts
Last active December 27, 2019 15:41
import-firebase-auth-from-twitter
import fs from "fs";
import request from "request-promise";
const consumerKey = "";
const consumerSecret = "";
const bearerTokenCredentials = Buffer.from(`${consumerKey}:${consumerSecret}`);
const base64EncodedBearerTokenCredentials = bearerTokenCredentials.toString(
"base64"
);
@ogawa0071
ogawa0071 / command.sh
Last active May 3, 2019 08:26
Ubuntu Desktop on GCE
sudo apt update && sudo apt upgrade
sudo apt install ubuntu-desktop
sudo apt install xrdp
sudo passwd futa
sudo passwd ubuntu
import axios, { AxiosResponse } from 'axios';
import * as querystring from 'querystring';
import * as fs from 'fs';
const endpoint = 'https://api.twitter.com';
const base64EncodedBearerTokenCredentials = '';
async function getToken(): Promise<string> {
const response = await axios.post(
`${endpoint}/oauth2/token`,
@ogawa0071
ogawa0071 / default.conf
Created March 10, 2019 03:47
docker run -d -p 8080:80 -v "$PWD"/default.conf:/etc/nginx/conf.d/default.conf -v "$PWD":/usr/share/nginx/html nginx
server {
listen 80;
server_name localhost;
#charset koi8-r;
#access_log /var/log/nginx/host.access.log main;
location / {
root /usr/share/nginx/html;
index index.html index.htm index.shtml;
@ogawa0071
ogawa0071 / stack.yml
Last active March 10, 2019 03:48
docker-compose -f stack.yml up
version: "3.1"
services:
wordpress:
image: wordpress
ports:
- 8080:80
environment:
WORDPRESS_DB_HOST: db
WORDPRESS_DB_USER: exampleuser
const fs = require("fs");
const child_process = require("child_process")
const main = async () => {
const domainGSuite = '';
const _user = JSON.parse((await fs.promises.readFile("_user.json", { encoding: "utf8" })))
const user = JSON.parse(await fs.promises.readFile("user.json", { encoding: "utf8" }))
// const __domain = JSON.parse(await fs.promises.readFile("__domain.json", {encoding: "utf8"}))
const _domain = JSON.parse(await fs.promises.readFile("_domain.json", { encoding: "utf8" }))