Skip to content

Instantly share code, notes, and snippets.

View chilic's full-sized avatar

Chilic chilic

View GitHub Profile
@chilic
chilic / poof.php
Last active September 18, 2021 22:48
php: Self-destruct message
<?php
echo "This message will self-destruct in ..\n";
foreach (range(3, 1, -1) as $num) {
echo "$num...\n";
sleep(1);
}
unlink(__FILE__);
echo "💨 Poof!\n";
[Unit]
Description=Gunicorn flask
After=network.target
[Service]
User=www-data
Group=www-data
WorkingDirectory=/home/app
Environment="PATH=/home/app/env/bin"
ExecStart=/home/app/env/bin/gunicorn --workers 4 --bind unix:/var/run/app.sock -m 007 app:app
@chilic
chilic / golang_job_queue.md
Created August 5, 2018 19:51 — forked from harlow/golang_job_queue.md
Job queues in Golang
package main
const MaxLength = 1 << 20
var (
addr = flag.String("listen", ":8000", "listen for requests")
numprocs = flag.Int("p", runtime.NumCPU(), "number of workers to start")
maxqueue = flag.Int("q", runtime.NumCPU()*2, "largest queue size")
jobs chan Job
@chilic
chilic / PULL_REQUEST_TEMPLATE.md
Last active January 20, 2020 09:54
PR example

[#issue id] Issue Title

Description:

  • Short description
  • Technical details

Affected pages:

  • [global]
  • [front]
  • /about
# Patch/diff artifacts.
*.diff
*.orig
*.rej
interdiff*.txt
# emacs artifacts.
*~
\#*\#
@chilic
chilic / gist:5803582
Created June 18, 2013 08:23
Debian memcached socket start script
#! /bin/sh
#
# chkconfig: - 55 45
# description: The memcached daemon is a network memory cache service.
# processname: memcached
# config: /etc/memcached.conf
# pidfile: /var/run/memcached/memcached.pid
# Standard LSB functions
. /lib/lsb/init-functions