Skip to content

Instantly share code, notes, and snippets.

View mosiyash's full-sized avatar

Nikita mosiyash

  • Novosibirsk, Russia
View GitHub Profile
@Prototype-X
Prototype-X / Install_pgAdmin4_with_python3_on_Ubuntu 16.04.md
Last active January 30, 2022 23:24
Install pgAdmin4 v2.0 with python3 on Ubuntu 16.04 DESKTOP mode

Install pgAdmin4 v2.0 with python3 on Ubuntu 16.04 DESKTOP mode

  1. Get Python Wheel pgAdmin4

     wget https://ftp.postgresql.org/pub/pgadmin/pgadmin4/v2.0/pip/pgadmin4-2.0-py2.py3-none-any.whl
    
  2. Install pip3

     sudo apt install python3-pip
    
@diegonobre
diegonobre / symfony3-rest-api.md
Last active January 5, 2024 14:36 — forked from tjamps/README.md
Basic RESTful API with Symfony 3 + FOSRestBundle (JSON format only) + FOSUserBundle + FOSOauthServerBundle

Basic RESTful API with Symfony 3 + FOSRestBundle (JSON format only) + FOSUserBundle + FOSOauthServerBundle

The API we are creating in this gist will follow these rules :

  • The API only returns JSON responses
  • All API routes require authenticationu
  • Authentication is handled via OAuth2 with password Grant Type only (no need for Authorization pages and such).
  • API versioning is managed via a subdomain (e.g. v1.api.example.com)

The API will be written in PHP with the Symfony 3 framework. The following SF2 bundles are used :

@SilverFire
SilverFire / config.php
Created October 24, 2015 09:16
Yii2 set timezone for DB connection
<?php
return [
'components' => [
'db' => [
'class' => '\yii\db\Connection',
'dsn' => 'mysql:host=127.0.0.1;dbname=demo',
'username' => 'root',
'password' => '',
'charset' => 'utf8',
@shark0der
shark0der / setup_mailcatcher.sh
Last active January 22, 2022 16:28 — forked from conroyp/setup_mailcatcher.sh
Mailcatcher installation script for Ubuntu 16.04 (14.04 commands commented out)
#!/bin/bash
# Install dependencies
# older ubuntus
#apt-get install build-essential libsqlite3-dev ruby1.9.1-dev
# xenial
apt install build-essential libsqlite3-dev ruby-dev
# Install the gem
gem install mailcatcher --no-ri --no-rdoc
@Vestride
Vestride / encoding-video.md
Last active April 24, 2024 09:59
Encoding video for the web

Encoding Video

Installing

Install FFmpeg with homebrew. You'll need to install it with a couple flags for webm and the AAC audio codec.

brew install ffmpeg --with-libvpx --with-libvorbis --with-fdk-aac --with-opus
@dmkuznetsov
dmkuznetsov / selectel.php
Created March 14, 2015 14:58
Selectel flysystem
<?php
use OpenCloud\OpenStack;
use League\Flysystem\Filesystem;
use League\Flysystem\Rackspace\RackspaceAdapter;
$client = new OpenStack('https://auth.selcdn.ru', [
'username' => '...',
'password' => '...'
]);
#!/bin/bash
PHANTOM_JS="phantomjs-1.9.8-linux-x86_64"
if [[ $EUID -ne 0 ]]; then
echo "You must be a root user" 2>&1
exit 1
else
apt-get update
apt-get install -y build-essential chrpath libssl-dev libxft-dev
apt-get install -y libfreetype6 libfreetype6-dev
apt-get install -y libfontconfig1 libfontconfig1-dev
@DuffleOne
DuffleOne / gist:659617c9fc24337d96e8
Created January 3, 2015 12:46
Example Symfony Console Command with CLImate
#! /usr/bin/env php
<?php
require_once 'vendor/autoload.php';
use Symfony\Component\Console\Application;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Output\OutputInterface;
use Symfony\Component\Console\Input\InputArgument;
@AkdM
AkdM / gist:49ae1d4115246a057526
Created October 24, 2014 14:09
Convert annotation to YAML for Symfony 2
php app/console doctrine:mapping:convert --namespace="MySuper\DuperBundle\Entity\MyEntity" yaml src/MySuper/DuperBundle/Resources/config/doctrine
That command will convert the annotation file into yaml format into src/MySuper/DuperBundle/Resources/config/doctrine as MySuper.DuperBundle.Entity.MyEntity.orm.yml