Skip to content

Instantly share code, notes, and snippets.

View k12u's full-sized avatar
🏠
Working from home

Minoru KAWAMOTO k12u

🏠
Working from home
View GitHub Profile
@k12u
k12u / editor.html
Created December 26, 2024 05:02
ブラウザタブで動かすエディタ
<!DOCTYPE html>
<html lang="ja">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>オフラインエディタ</title>
<style>
/* テキストエリアがリサイズ可能であることを示す */
textarea {
resize: vertical;
@gmr
gmr / consul.lua
Created July 14, 2014 17:03
Dynamic Nginx upstream nodes using Consul
module("resty.consul", package.seeall)
_VERSION = '0.1.0'
function service_nodes(service)
local http = require "resty.http"
local json = require "cjson"
local hc = http:new()
local upstream = ""
@xaviervia
xaviervia / nginx-environment.md
Last active July 1, 2019 12:45
Nginx and Docker links with environment variables, a love story

How to add environment variables to nginx.conf

This is the hack approach to adding environment variables to the nginx configuration files. As with most Google results for this search, the reason is Docker.

The setup

I intended to deploy two Docker containers.

@colindean
colindean / vagrant-scp.sh
Last active March 27, 2025 18:19
A quick way to transfer a file to the home directory on a Vagrant VM
#!/bin/sh
OPTIONS=`vagrant ssh-config | awk -v ORS=' ' '{print "-o " $1 "=" $2}'`
scp ${OPTIONS} "$@" || echo "Transfer failed. Did you use 'default:' as the target?"
@hirose31
hirose31 / gist:1891020
Created February 23, 2012 06:15
daemontools詰め合わせ
### helper shell function
daemonup() {
[ -z "$1" ] && return
case $1 in
*/*)
DAEMONDIR=$1
;;
*)
if [ -d "$SYS_HOME" ]; then
@zigorou
zigorou / poll.pl
Created October 25, 2011 13:40
perl echo servers
#!/usr/bin/env perl
use strict;
use warnings;
use FindBin;
use lib "$FindBin::Bin/../lib";
use Getopt::Long;
use IO::Socket::INET;
use IO::Poll;
use Log::Minimal;