Skip to content

Instantly share code, notes, and snippets.

View ildarusmanov's full-sized avatar
🎯
Focusing

Ildar ildarusmanov

🎯
Focusing
View GitHub Profile
@ildarusmanov
ildarusmanov / main.go
Created June 19, 2023 12:26
Generate self-signed certificates for k8s DAC WebHooks
package main
import (
"bytes"
"crypto/rand"
"crypto/rsa"
"crypto/tls"
"crypto/x509"
"crypto/x509/pkix"
"encoding/base64"
// From sources for https://watermill.io/docs/getting-started/
package main
import (
"context"
"log"
"time"
"github.com/ThreeDotsLabs/watermill"
"github.com/ThreeDotsLabs/watermill-amqp/pkg/amqp"
package resource
import (
"encoding/base64"
"fmt"
"io"
"io/ioutil"
"net/url"
"os"
"os/exec"
version: '3.4'
services:
zookeeper:
image: confluentinc/cp-zookeeper:latest
environment:
ZOOKEEPER_CLIENT_PORT: 2181
ZOOKEEPER_TICK_TIME: 2000
kafka:
image: confluentinc/cp-kafka:latest
depends_on:
version: '3.6'
services:
nginx:
restart: always
build: docker/nginx
ports:
- 80:80
volumes:
- webapp:/var/www/app
links:
@ildarusmanov
ildarusmanov / install.sh
Created March 1, 2018 13:43 — forked from ziadoz/install.sh
Install Chrome, ChromeDriver and Selenium on Ubuntu 16.04
#!/usr/bin/env bash
# https://developers.supportbee.com/blog/setting-up-cucumber-to-run-with-Chrome-on-Linux/
# https://gist.github.com/curtismcmullan/7be1a8c1c841a9d8db2c
# http://stackoverflow.com/questions/10792403/how-do-i-get-chrome-working-with-selenium-using-php-webdriver
# http://stackoverflow.com/questions/26133486/how-to-specify-binary-path-for-remote-chromedriver-in-codeception
# http://stackoverflow.com/questions/40262682/how-to-run-selenium-3-x-with-chrome-driver-through-terminal
# http://askubuntu.com/questions/760085/how-do-you-install-google-chrome-on-ubuntu-16-04
# Versions
CHROME_DRIVER_VERSION=`curl -sS chromedriver.storage.googleapis.com/LATEST_RELEASE`
language: go
go:
- 1.8.x
services:
- rabbitmq
env:
- AMQP_URL=amqp://guest:guest@127.0.0.1:5672/
install:
- go get -u github.com/golang/dep/cmd/dep
- dep ensure
@ildarusmanov
ildarusmanov / _403.php
Created October 27, 2017 08:38
error.php
use yii\helpers\Html;
/* @var $this yii\web\View */
/* @var $code int */
/* @var $name string */
/* @var $message string */
/* @var $exception Exception */
$this->title = 'Нет доступа';
$this->params['breadcrumbs'][] = $this->title;
class Account::ApplicationsController < Account::ApplicationController
expose :applications, ->{ current_user.applications }
expose :application, ancestor: :current_user
def create
if application.save
redirect_to account_application_path(application)
else
render :new
end
package main
import (
"project7/models"
"project7/controllers"
)
func main() {
// create article model
artcl := models.CreateArticle("New article")