- Install docker and docker compose
brew install docker docker-compose
- Configure the docker plugin to recognize it as the
docker compose
command.
mkdir -p ~/.docker/cli-plugins
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'] : {}) |
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 |
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')) { |
// 既定の設定を上書きするには、このファイル内に設定を挿入します | |
{ | |
"editor.tabSize": 2, | |
"editor.renderWhitespace": "boundary", | |
"workbench.colorTheme": "Material Theme", | |
"workbench.iconTheme": "vscode-icons", | |
"workbench.editor.enablePreviewFromQuickOpen": false, | |
"window.zoomLevel": 1, | |
"window.newWindowDimensions": "maximized" | |
} |
#! /bin/bash | |
cd $(dirname $0) | |
# 現在パスが通っているchromedriverのバージョンと、chromedriverで公開されている | |
# 最新のchromedriverのバージョンを比較し、新しくなっている場合は更新する。 | |
# chromedriverの保存先 | |
CURRENT_CHROMEDRIVER=/home/user/bin/chromedriver | |
CHROMEDRIVER_ARCHIVE_DIR=/home/user/bin/selenium-webdriver/chromedriver/ |
'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/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 |
brew install docker docker-compose
docker compose
command.mkdir -p ~/.docker/cli-plugins
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(); |