Skip to content

Instantly share code, notes, and snippets.

View beautyfree's full-sized avatar
😼

Alexey Elizarov beautyfree

😼
View GitHub Profile
ФИ: Александр Байбородов
Ник: Kondor (GoXLd)
Дата рождения: 25 сентября 1991 г.
Город: Екатеринбург
Адрес: ул. 8-го марта, д.82
Индекс: 620144
Моб. телефон: 8-912-2222-079 МТС Екб, 8-952-73-73-223 Мотив Екб (iphone 3g)
Учится: 130406 Шахтное и подземное строительство ШС в Уральский государственный горный университет
Группа: ШС-09
@beautyfree
beautyfree / gist:1353884
Created November 10, 2011 02:04
Action
<?
//===============================================================
protected function EventOnline(){
$this->sMenuItemSelect='online';
$sCompany=$this->sCurrentEvent;
$iPage=$this->GetParamEventMatch(1,2) ? $this->GetParamEventMatch(1,2) : 1;
if(!($oCompany=$this->PluginCompany_Company_GetCompanyWithAddData($sCompany))) return parent::EventNotFound();
$aResult=$this->PluginCompany_Company_GetOnlineByCompanyId($oCompany->getId(),$iPage,Config::Get('module.online.per_page'));
$aOnline=$aResult['collection'];
$aPaging=$this->Viewer_MakePaging($aResult['count'],$iPage,Config::Get('module.online.per_page'),4,Config::Get('module.company.url').'/'.$sCompany.'/online/');
@beautyfree
beautyfree / gist:1408967
Created November 30, 2011 12:54
ls clicker
var ls = ls || {};
/**
* Управление всплывающими сообщениями
*/
ls.msg = (function ($) {
/**
* Опции
*/
this.options = {
@beautyfree
beautyfree / gist:1475769
Created December 14, 2011 08:43
server.js
#!/usr/bin/env node
var net = require("net"),
sys = require("util"),
socketFile = "/tmp/node-socket";
var io = require('socket.io').listen(8003);
io.set('log level', 1);
io.set('resource','/api');
<?php
function sxe($url) {
$xml = file_get_contents($url);
foreach ($http_response_header as $header) {
if (preg_match('#^Content-Type: text/xml; charset=(.*)#i', $header, $m)) {
switch (strtolower($m[1])) {
case 'utf-8':
<?php
header('Content-Type: text/html; charset=utf-8');
$xml; // Зачем?
function sxe($url) {
$xml = file_get_contents($url);
foreach ($http_response_header as $header) {
if (preg_match('#^Content-Type: text/xml; charset=(.*)#i', $header, $m)) {
switch (strtolower($m[1])) {
@beautyfree
beautyfree / APPNAME
Created January 7, 2012 14:37 — forked from eculver/APPNAME
init.d script for node.js for debian
#! /bin/sh
# ------------------------------------------------------------------------------
# SOME INFOS : fairly standard (debian) init script.
# Note that node doesn't create a PID file (hence --make-pidfile)
# has to be run in the background (hence --background)
# and NOT as root (hence --chuid)
#
# MORE INFOS : INIT SCRIPT http://www.debian.org/doc/debian-policy/ch-opersys.html#s-sysvinit
# INIT-INFO RULES http://wiki.debian.org/LSBInitScripts
# INSTALL/REMOVE http://www.debian-administration.org/articles/28
@beautyfree
beautyfree / node_debian_init.sh
Created January 22, 2012 13:34 — forked from peterhost/node_debian_init.sh
Daemon init script for node.js based app/server (DEBIAN/UBUNTU)
#!/bin/sh
# ------------------------------------------------------------------------------
# SOME INFOS : fairly standard (debian) init script.
# Note that node doesn't create a PID file (hence --make-pidfile)
# has to be run in the background (hence --background)
# and NOT as root (hence --chuid)
#
# MORE INFOS : INIT SCRIPT http://www.debian.org/doc/debian-policy/ch-opersys.html#s-sysvinit
# INIT-INFO RULES http://wiki.debian.org/LSBInitScripts
# INSTALL/REMOVE http://www.debian-administration.org/articles/28
<?php
error_reporting(E_ALL);
ini_set('display_errors', 1);
/* Load required lib files. */
session_start();
require_once('twitteroauth/twitteroauth.php');
require_once('config.php');
require_once('DbSimple/lib/DbSimple/Generic.php');
{if $oLocation and $oLocation->getLatLng() != 0}
<script type="text/javascript" src="http://code.google.com/apis/gears/gears_init.js" charset="utf-8"></script>
{if Config::Get('plugin.location.yandex.use')}
<script type="text/javascript" src="http://api-maps.yandex.ru/1.1/index.xml?key={$oConfig->GetValue('plugin.location.yandex.key')}&modules=regions~pmap"></script>
<script type="text/javascript">
devall.location.options.provider = 'yandex';
{if Config::Get('plugin.location.yandex.type') == 'nmap'}
devall.location.options.yandex_type = '{Config::Get('plugin.location.yandex.type')}';
{/if}
</script>