If you plan to use iconv()
to transliterate string in you PHP project, please, take this:
FROM alpine:3.4
RUN apk add --update php5-cli wget build-base php5-dev autoconf re2c libtool \
# used by Git (commit messages, rebase, ...) | |
export EDITOR=vim |
// Simulating infinite-length leading lookbehind in JavaScript. Uses XRegExp. | |
// Captures within lookbehind are not included in match results. Lazy | |
// repetition in lookbehind may lead to unexpected results. | |
(function (XRegExp) { | |
function prepareLb(lb) { | |
// Allow mode modifier before lookbehind | |
var parts = /^((?:\(\?[\w$]+\))?)\(\?<([=!])([\s\S]*)\)$/.exec(lb); | |
return { |
#!/bin/bash | |
# Usage: yt-whisper URL [OUTPUT_FILENAME_TEMPLATE [LANGUAGE]] | |
# If OUTPUT_FILENAME_TEMPLATE is empty, output is yt-whisper-video | |
# If LANGAUGE is empty, it is set to "auto" | |
# General settings (paths) for whisper.cpp | |
# Note - this uses whisper.cpp, not official whisper. Get it at | |
# https://github.com/ggerganov/whisper.cpp | |
# You will have to adjust these |
<?php | |
$db = new PDO( | |
"pgsql:dbname=postgres host=localhost port=5432", 'postgres', 'postgres', [ | |
PDO::ATTR_ERRMODE => PDO::ERRMODE_EXCEPTION, | |
PDO::ATTR_DEFAULT_FETCH_MODE => PDO::FETCH_ASSOC, | |
] | |
); | |
$db->exec('LISTEN hoge'); |
#!/bin/bash | |
# deploy serverless stack | |
serverless deploy \ | |
--stage "dev" \ | |
--region "us-east-1" \ | |
--service-name "my-service-name" \ | |
--slack-channel "#slack-alerts-example" \ | |
--webhook-url "https://hooks.slack.com/services/12345/12345/abcdefg" \ | |
--ecs-cluster-arn "arn:aws:ecs:us-east-1:123456:cluster/test-cluster" |
# put this in ~/.bashrc | |
export SSH_AUTH_SOCK=/tmp/.ssh-socket | |
ssh-add -l > /dev/null | |
if [ $? = 2 ]; then | |
rm -f $SSH_AUTH_SOCK | |
echo Starting new ssh-agent... | |
eval $(ssh-agent -a $SSH_AUTH_SOCK) > /dev/null | |
ssh-add && echo "ssh-agent set up successfully with the following keys:" && ssh-add -l | |
fi |
#!/usr/bin/env bash | |
# ----------------------------------------------------------------------------- | |
# Safety settings (see https://gist.github.com/ilg-ul/383869cbb01f61a51c4d). | |
if [[ ! -z ${DEBUG} ]] | |
then | |
set ${DEBUG} # Activate the expand mode if DEBUG is anything but empty. | |
else | |
DEBUG="" |
# File: etc/default/docker | |
# Use DOCKER_OPTS to modify the daemon startup options. | |
#DOCKER_OPTS="" | |
DOCKER_OPTS="--dns 8.8.8.8 --dns 8.8.4.4 -H tcp://127.0.0.1:2375 -H unix:///var/run/docker.sock" |
# if not running interactively, don't do anything | |
[ -z "$PS1" ] && return | |
# Detect platform | |
platform='unknown' | |
unamestr=`uname` | |
if [[ "$unamestr" == 'Linux' ]]; then | |
platform='linux' | |
elif [[ "$unamestr" == 'FreeBSD' ]]; then | |
platform='freebsd' |