Skip to content

Instantly share code, notes, and snippets.

const Encore = require('@symfony/webpack-encore');
// Manually configure the runtime environment if not already configured yet by the "encore" command.
// It's useful when you use tools that rely on webpack.config.js file.
if (!Encore.isRuntimeEnvironmentConfigured()) {
Encore.configureRuntimeEnvironment(process.env.NODE_ENV || 'dev');
}
Encore
// directory where compiled assets will be stored
package main
import (
"context"
"crypto/tls"
log "github.com/sirupsen/logrus"
"go.mongodb.org/mongo-driver/mongo"
"go.mongodb.org/mongo-driver/mongo/options"
"go.mongodb.org/mongo-driver/bson"
"net/http"
@u7ter
u7ter / editDnsCloudflare.php
Created April 28, 2020 10:16
edit Dns Cloudflare api
<?
/**
mydomain.com
stage.mydomain.com edit to new ip
*/
require_once('vendor/autoload.php');
$key = new \Cloudflare\API\Auth\APIKey('[email protected]', 'key');
$adapter = new Cloudflare\API\Adapter\Guzzle($key);
@u7ter
u7ter / api.go
Created October 1, 2017 19:04
Создания API RESTful сервера с Golang и MySQL
package main
import (
"net/http"
"github.com/gin-gonic/gin"
"github.com/jinzhu/gorm"
_ "github.com/jinzhu/gorm/dialects/mysql"
)
@u7ter
u7ter / 1-Explanations.md
Created September 24, 2017 18:38 — forked from danvbe/1-Explanations.md
A way to integrate FosUserBundle and HWIOAuthBundle

I have managed to install this… and make it work. I implemented it for Facebook and Google, but you can extend it. My solution it is mostly as described in #116, with a bit of more code presented. The key aspects that lack in the #116 presentation (IMO) are:

  • the registration as service of your custom FOSUBUserProvider (with the necessary parameters)
  • set the service for oauth_user_provider in the security.yml with your custom created service

Here are the steps:

  1. Routing. In routing.yml I have added all the routes for both bundles.
  2. Configuration. I have set the config.yml mostly as it is presented in the HWIOAuthBundle.
  3. Security. I have set the security.yml mostly as it is presented in the HWIOAuthBundle (though my routes are using /login pattern, not /connect). Also, the oauth_user_provider is set for my custom service.
<div class="popup middle-popup size-table-popup">
<div class="close-btn">
<i class="fa fa-times" aria-hidden="true"></i>
</div>
<div class="popup-heading">Таблица размеров</div>
<form class="ui form">
<img src="img/img-table-size.png" alt="таблица размеров"/>
@u7ter
u7ter / httpserver.go
Created May 30, 2017 17:55
http server golang
package main
import (
"fmt" // пакет для форматированного ввода вывода
"net/http" // пакет для поддержки HTTP протокола
"strings" // пакет для работы с UTF-8 строками
"log" // пакет для логирования
)
func HomeRouterHandler(w http.ResponseWriter, r *http.Request) {
@u7ter
u7ter / ajax_load_bx.php
Created March 15, 2017 11:14
ajax_load_bx.php
<div id="ajaxpages_reviewsuser" class="user-msg-holder">
<?
global $APPLICATION, $JSON;
if($_REQUEST['ajaxpages']=='Y' && $_REQUEST['ajaxpagesid']=='ajaxpages_reviewsuser')
{
$IS_AJAXPAGES = 'Y';
$JSON['TYPE'] = 'OK';
}?>
<?$APPLICATION->IncludeComponent(
@u7ter
u7ter / List.md
Created November 7, 2016 10:58 — forked from msurguy/List.md
List of open source projects made with Laravel

Other people's projects:

My projects (tutorials are on my blog at http://maxoffsky.com):

@u7ter
u7ter / index.php
Created October 3, 2016 14:05
Bitrix. New order d7
Так можно ручками создать заказ
<?require($_SERVER["DOCUMENT_ROOT"]."/bitrix/modules/main/include/prolog_before.php");
global $USER;
use \Bitrix\Main,
\Bitrix\Main\Localization\Loc as Loc,
Bitrix\Main\Loader,
Bitrix\Main\Config\Option,
Bitrix\Sale\Delivery,