Skip to content

Instantly share code, notes, and snippets.

package main
import (
"fmt"
"github.com/moovweb/gokogiri"
"io/ioutil"
"net/http"
"net/url"
"time"
)
<VirtualHost 127.0.0.1:81>
DocumentRoot "/absolute/path/to/project/www"
DirectoryIndex index.php
ServerAdmin [email protected]
ServerAlias test.dev
ErrorLog "/absolute/path/to/project/logs/apache-error.log"
CustomLog "/absolute/path/to/project/logs/apache-access.log" common
#!/usr/bin/perl
use strict;
use warnings;
my $exclude_list_path_static = "/etc/ovznodes_backup_rsync_exclude_list.static";
my $exclude_list_path_dynamic = "/etc/ovznodes_backup_rsync_exclude_list.dynamic";
my $config_file_path = '/etc/ovznodes_backup_config';
# должна объявляться в конфиге
package main
import (
"github.com/coreos/go-etcd/etcd"
"log"
"strings"
)
var etcdKey string
var backends []string
<?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,
$qs = User::objects();
$qs = $qs->filter(...);
$qs = $qs->exclude(...);
$qs = $qs->order();
<?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);
<?php
/**
* NestedSetBehavior class file.
*
* @author Alexander Kochetov <[email protected]>
* @link https://github.com/yiiext/nested-set-behavior
*/
/**
* Provides nested set functionality for a model.
import os
import sys
import MySQLdb
MYSQL_HOST = "localhost"
MYSQL_USER = "testuser"
MYSQL_PASSWORD = "testpass"
MYSQL_DB = "test"
@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