- Install docker and docker compose
brew install docker docker-compose- Configure the docker plugin to recognize it as the
docker composecommand.
mkdir -p ~/.docker/cli-plugins| import { type GoogleKey } from 'cloudflare-workers-and-google-oauth' | |
| import GoogleAuth from 'cloudflare-workers-and-google-oauth' | |
| const SCOPES = ['https://www.googleapis.com/auth/cloud-platform'] | |
| export const execute = async <T>( | |
| gcpServiceAccount: string, | |
| endpoint: string, | |
| requestInit: RequestInit, | |
| ): Promise<{ result: boolean; data: T }> => { |
| import { Client } from "pg"; | |
| import { drizzle } from "drizzle-orm/node-postgres"; | |
| import * as schema from "../drizzle/schema"; | |
| import { Logger } from "drizzle-orm/logger"; | |
| export async function createContext() { | |
| const client = new Client({ | |
| connectionString: "your database connection string", | |
| }); | |
| await client.connect(); |
brew install docker docker-composedocker compose command.mkdir -p ~/.docker/cli-plugins| #!/bin/sh | |
| IFS=$',' | |
| CACHE_DIRS="public/assets,tmp/cache" | |
| WORK_DIR_IN_DOCKER="/app" | |
| i=1 | |
| docker run -it -d --entrypoint /bin/sh --name run_cache_container <image name> -c /bin/sh |
| 'use strict' | |
| const aws = require('aws-sdk') | |
| const LineStream = require('byline').LineStream | |
| const client = require('cheerio-httpcli') | |
| const s3 = new aws.S3({ apiVersion: '2006-03-01' }) | |
| const ls = new LineStream() | |
| exports.handler = (event, context, callback) => { |
| #! /bin/bash | |
| cd $(dirname $0) | |
| # 現在パスが通っているchromedriverのバージョンと、chromedriverで公開されている | |
| # 最新のchromedriverのバージョンを比較し、新しくなっている場合は更新する。 | |
| # chromedriverの保存先 | |
| CURRENT_CHROMEDRIVER=/home/user/bin/chromedriver | |
| CHROMEDRIVER_ARCHIVE_DIR=/home/user/bin/selenium-webdriver/chromedriver/ |
| // 既定の設定を上書きするには、このファイル内に設定を挿入します | |
| { | |
| "editor.tabSize": 2, | |
| "editor.renderWhitespace": "boundary", | |
| "workbench.colorTheme": "Material Theme", | |
| "workbench.iconTheme": "vscode-icons", | |
| "workbench.editor.enablePreviewFromQuickOpen": false, | |
| "window.zoomLevel": 1, | |
| "window.newWindowDimensions": "maximized" | |
| } |
| import React, { Component } from 'react' | |
| import $ from 'jquery' | |
| import nl2br from 'react-nl2br' | |
| export default class MarueeMessage extends Component { | |
| autoScrollStart() { | |
| $("div.maruee").css('position', 'relative') | |
| let text_height = $("div.maruee p#first").height() | |
| if (text_height > $("div.display-area").height()) { | |
| if (!$('div.maruee').is(':animated')) { |
| module DatetimeIntegratable | |
| extend ActiveSupport::Concern | |
| included do | |
| after_initialize :initialize_integrate_datetime | |
| def initialize_integrate_datetime | |
| self.class.datetime_integrate_targets.each do |attribute| | |
| decompose_datetime(attribute) | |
| end |
| class TwilioBaseController < ActionController::Base | |
| before_filter :authenticate_twilio_request | |
| private | |
| def authenticate_twilio_request | |
| twilio_sig = request.headers['HTTP_X_TWILIO_SIGNATURE'] | |
| render :xml => (Twilio::TwiML::Response.new {|r| r.Hangup}).text and return if twilio_sig.blank? | |
| twilio_validator = Twilio::Util::RequestValidator.new("YOUR TWILIO AUTH TOKEN") | |
| params_for_auth = (request.post? ? env['rack.request.form_hash'] : {}) |