Skip to content

Instantly share code, notes, and snippets.

[program:something_uwsgi]
user=something
process_name=%(program_name)s
directory=/home/something/something.info
command=/usr/bin/uwsgi -y /home/something/something.info/app/uwsgi.yaml
stdout_logfile=/home/something/something.info/log/supervisord_uwsgi.log
stderr_logfile=/home/something/something.info/log/supervisord_uwsgi.error
autostart=true
autorestart=true
redirect_stderr=true
user www-data;
worker_processes 4;
pid /var/run/nginx.pid;
events {
worker_connections 768;
# multi_accept on;
use epoll;
multi_accept on;
}
<script type="text/ng-template" id="one.html">
<div>This is first template</div>
</script>
<script type="text/ng-template" id="two.html">
<div>This is second template</div>
</script>
@max107
max107 / 0_reuse_code.js
Created January 26, 2014 16:41
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
import os
import sys
import MySQLdb
MYSQL_HOST = "localhost"
MYSQL_USER = "testuser"
MYSQL_PASSWORD = "testpass"
MYSQL_DB = "test"
<?php
/**
* NestedSetBehavior class file.
*
* @author Alexander Kochetov <[email protected]>
* @link https://github.com/yiiext/nested-set-behavior
*/
/**
* Provides nested set functionality for a model.
<?php
$criteria = new CDbCriteria();
$criteria->condition = "status IN(1)";
$criteria->mergeWith($model->lang()->children()->getDbCriteria());
$criteria->order = "type ASC, create_time DESC";
Pages::model()->findAll($criteria);
$qs = User::objects();
$qs = $qs->filter(...);
$qs = $qs->exclude(...);
$qs = $qs->order();
<?php
$user_qs = User::objects()->filter([
'group__permission__code__in' => [
'can_create' => true,
'can_update' => true,
'can_delete' => false
],
'is_active__isnull' => false,
'cart__price__gte' => 10000,
package main
import (
"github.com/coreos/go-etcd/etcd"
"log"
"strings"
)
var etcdKey string
var backends []string