Skip to content

Instantly share code, notes, and snippets.

package contractor
import (
"utils/logger"
"utils/crypt"
helpfullObject "helpfull/objects"
"app/components/contractor/licenses"
"app/models"
"app/events"
<?php
/**
* Widgets Tag Processor (sample)
*
*/
class SampleWidget extends TagProcessor
{
/**
@gebv
gebv / frontmost_window.py
Created October 20, 2015 15:44 — forked from ljos/frontmost_window.py
Find the frontmost/active window in OS X
# Copyright @ Bjarte Johansen 2012
# License: http://ljos.mit-license.org/
from AppKit import NSApplication, NSApp, NSWorkspace
from Foundation import NSObject, NSLog
from PyObjCTools import AppHelper
from Quartz import kCGWindowListOptionOnScreenOnly, kCGNullWindowID, CGWindowListCopyWindowInfo
class AppDelegate(NSObject):
def applicationDidFinishLaunching_(self, notification):
@gebv
gebv / num2word.js
Last active November 6, 2015 16:36
numbers to words converter
var a = ['','одной ','двух ','трех ','четырех ', 'пяти ','шести ','семи ','восьми ','девяти ','десяти ','одиннадацти ','двенадцати ','тринадцати ','четырнадцати ','пятьнадцати ','шестьнадцати ','семьнадцати ','восемьнадцати ','девятьнадцати '];
var tenthsNums = ['', '', 'двадцати','тридцати','сорока','пятидесяти', 'шестидесяти','семидесяти','восьмидесяти','девяноста'];
var hundredsNums = ['', 'ста', 'двухсот', "трехсот", "четырехсот", "пятисот", "шестисот", "семисот", "восемисот", "девятисот"];
var hundreds = ["сотня", "сотни", "сотен"];
var thousands = ["тысячи", "тысячи", "тысяч"];
var million = ["миллиона", "миллионов", "миллионов"];
var fTenths = ["десятых", "десятых", "десятых"];
@gebv
gebv / Makefile
Last active December 25, 2015 08:27
makefile for the build of any golang application with vendors packages
.PHONY: build doc fmt test vendor_clean vendor_get vendor_update vet run stop
GOPATH := ${PWD}:${PWD}/vendor
APPPKG := fsv2
CMDRUN := cmd/server
LOGPATH := ./bin/logs
LOGCURRENT := $(APPPKG)
PIDFILE := ./bin/$(APPPKG).run.pid
@gebv
gebv / http_helpful.go
Last active November 28, 2015 03:58
helpful http
package core
import (
"encoding/json"
"net/http"
"io/ioutil"
)
type ResponseSuccess struct {
Code string `json:"code"`
@gebv
gebv / tpl_manager.go
Created November 28, 2015 07:12
manager templates
package core
import (
"bytes"
"github.com/golang/glog"
"html/template"
"os"
"path/filepath"
)
@gebv
gebv / models_db.go
Last active December 8, 2015 12:18
helpful models
package internal
import (
"fmt"
"regexp"
"strconv"
"strings"
)
type SqlTypeUpdate string
@gebv
gebv / sordlist.sql
Created December 29, 2015 07:37
Сортировка результата по произвольному списку
SELECT * FROM classifer WHERE classifer_id IN (60,61,59) ORDER BY position(classifer_id::text in '60, 61, 59')
@gebv
gebv / Makefile
Last active January 19, 2016 14:50
Makefile запуск и остановка приложения по PID
.PHONY: deploy setup start stop
LASTBUILD := `cd ../builds && ls -1t | head -1`
STAMP := `date +%s`
BUILD := `date -u '+%Y_%m_%d-%I_%M_%S'`
PIDFILE := ./bin/app.pid
ifneq ("$(wildcard $(PIDFILE))","")
PID=$(shell cat $(PIDFILE))
endif