Skip to content

Instantly share code, notes, and snippets.

View topwebmaster's full-sized avatar
:octocat:
Always answer.

Dmitriy Petrov topwebmaster

:octocat:
Always answer.
View GitHub Profile
[{'Code': 14,
'DivName': '',
'Enabled': 1,
'GrpID': 3,
'ID': 16,
'IsAdditive': 0,
'Name': 'Капричеза 40 см',
'Portion': ' ',
'Price': 199.0,
'SelfPrice': 77.36578,
@topwebmaster
topwebmaster / composing-software.md
Created November 29, 2019 18:24 — forked from Geoff-Ford/composing-software.md
Eric Elliott's Composing Software Series
@topwebmaster
topwebmaster / Drive.php
Created November 20, 2018 05:46 — forked from bshaffer/Drive.php
Google Drive API (v3) - PHP
<?php
/*
* Copyright 2010 Google Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not
* use this file except in compliance with the License. You may obtain a copy of
* the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
@topwebmaster
topwebmaster / 0_reuse_code.js
Created December 8, 2016 08:03
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
@topwebmaster
topwebmaster / install_postgis_osx.sh
Created June 17, 2016 14:32 — forked from lucasallan/install_postgis_osx.sh
Installing PostGIS on Mac OS X and Ubuntu
# Some good references are:
# http://russbrooks.com/2010/11/25/install-postgresql-9-on-os-x
# http://www.paolocorti.net/2008/01/30/installing-postgis-on-ubuntu/
# http://postgis.refractions.net/documentation/manual-1.5/ch02.html#id2630392
#1. Install PostgreSQL postgis and postgres
brew install postgis
initdb /usr/local/var/postgres
pg_ctl -D /usr/local/var/postgres -l /usr/local/var/postgres/server.log start
@topwebmaster
topwebmaster / gunicorn_start.bash
Created December 26, 2015 07:45 — forked from postrational/gunicorn_start.bash
Example of how to set up Django on Nginx with Gunicorn and supervisordhttp://michal.karzynski.pl/blog/2013/06/09/django-nginx-gunicorn-virtualenv-supervisor/
#!/bin/bash
NAME="hello_app" # Name of the application
DJANGODIR=/webapps/hello_django/hello # Django project directory
SOCKFILE=/webapps/hello_django/run/gunicorn.sock # we will communicte using this unix socket
USER=hello # the user to run as
GROUP=webapps # the group to run as
NUM_WORKERS=3 # how many worker processes should Gunicorn spawn
DJANGO_SETTINGS_MODULE=hello.settings # which settings file should Django use
DJANGO_WSGI_MODULE=hello.wsgi # WSGI module name
@topwebmaster
topwebmaster / Jetbrains Idea PhpStorm Pycharm
Last active December 16, 2015 20:12
Настройки Ubuntu/Mint после установки
Сглаживание шрифтов
-Dawt.useSystemAAFontSettings=lcd
-Dswing.aatext=true
-Dawt.useSystemAAFontSettings=on
-Dsun.java2d.xrender=true
#!/bin/bash
## Common Packages
# ---------------
sudo apt-get -y update
sudo apt-get -y upgrade
sudo apt-get -y install software-properties-common libssl-dev openssl wget
## Install latest Python 3
# -----------------------
PY_VERSION=3.4.3
@topwebmaster
topwebmaster / Nginx config for Drupal 7
Last active August 29, 2015 14:24
Ubuntu+Nginx+Apache+PHP+MySQL+PhpMyAdmin
server {
server_name domain.tld;
root /var/www/drupal7; ## <-- Your only path reference.
# Enable compression, this will help if you have for instance advagg‎ module
# by serving Gzip versions of the files.
gzip_static on;
location = /favicon.ico {
log_not_found off;
@topwebmaster
topwebmaster / functions.php
Last active August 29, 2015 14:09
Разное
<?php
add_action( 'init', 'create_team_contacts' );
function create_team_contacts() {
register_post_type( 'team_contacts',
array(
'labels' => array(
'name' => 'Команда сайта',
'singular_name' => 'Контакт команды',
'add_new' => 'Добавить новый',