Skip to content

Instantly share code, notes, and snippets.

@noveogroup-amorgunov
noveogroup-amorgunov / README.md
Last active January 26, 2026 13:19
(Материалы) Я 💛 Фронтенд / Копаем глубже в Feature-Sliced Design
@trinhtanloc789
trinhtanloc789 / index.html
Created November 1, 2019 12:40
Swiper custom transition effect
<div class="swiper-container">
<div class="swiper-wrapper">
<div class="swiper-slide" style="background-image:url(https://picsum.photos/1920/1080?image=991)">
</div>
<div class="swiper-slide" style="background-image:url(https://picsum.photos/1920/1080?image=1081)">
</div>
<div class="swiper-slide" style="background-image:url(https://picsum.photos/1920/1080?image=1064)">
</div>
<div class="swiper-slide" style="background-image:url(https://picsum.photos/1920/1080?image=1000)">
</div>'
@monochromer
monochromer / promise-patterns.js
Last active September 17, 2024 13:06
Паттерны использования promise (Promise Patterns)
/*
conf: Falsy Values 2015
author: Kornel Lesinski
theme: And .then() what? Promise programming patterns
link: https://www.youtube.com/watch?v=KrhQE8K2I7Q
*/
// 1 waterfall. Использование результатов предыдущих промисов
doFirst()
.then(firstResult => {
@lsv
lsv / Menu.php
Last active January 11, 2020 10:40
Symfony 4 - KnpMenuBundle - menu with event
<?php
// src/Menu/Menu.php
namespace App\Menu;
use App\Event\Menu\Topbar\UserMenuEvent;
use Knp\Menu\FactoryInterface;
use Knp\Menu\ItemInterface;
use Symfony\Component\EventDispatcher\EventDispatcherInterface;
use Symfony\Component\HttpFoundation\RequestStack;
@Llewellynvdm
Llewellynvdm / Requests.php
Created August 6, 2017 20:30 — forked from xeoncross/Requests.php
cURL asynchronous requests using curl_multi and callbacks
<?php
/**
* Make asynchronous requests to different resources as fast as possible and process the results as they are ready.
*/
class Requests
{
public $handle;
public function __construct()
{
@ozrabal
ozrabal / index.html
Created October 27, 2016 13:44
Swiper custom slides transform effect
<!-- Swiper -->
<div class="swiper-container">
<div class="swiper-wrapper">
<div class="swiper-slide">
<div class="slide-inner" style="background-image: url('http://cs412624.vk.me/v412624691/4117/RWBNZL6CLtU.jpg')"></div>
</div>
<div class="swiper-slide">
<div class="slide-inner" style="background-image: url('http://cs412624.vk.me/v412624691/41ad/atM6w55Z9Xg.jpg')"></div>
</div>
<div class="swiper-slide">
@rafasashi
rafasashi / curl_multi_exec_functions.php
Created July 3, 2016 18:20
Implementation of curl_multi_exec for parallel processing
function custom_curl_multi_exec($mh, &$running){
do{
$rv = curl_multi_exec($mh, $running);
}
while ($rv === CURLM_CALL_MULTI_PERFORM);
@darylldoyle
darylldoyle / autoload.php
Last active November 18, 2022 14:54
PSR-4 Autoload Wordpress
<?php
/**
* An example of a general-purpose implementation that includes the optional
* functionality of allowing multiple base directories for a single namespace
* prefix.
*
* Given a foo-bar package of classes in the file system at the following
* paths ...
*
@Rarst
Rarst / class-autoload-wp.php
Created February 27, 2013 17:47
Generic autoloader for classes named in WordPress coding style.
<?php
if ( ! class_exists( 'Autoload_WP' ) ) {
/**
* Generic autoloader for classes named in WordPress coding style.
*/
class Autoload_WP {
public $dir = __DIR__;
@bmatheny
bmatheny / gist:991247
Created May 25, 2011 16:02
curl_multi speed for PHP
<?php
class CurlMulti
{
// Code from http://www.somacon.com/p537.php
public static function getMulti(array $urls)
{
// Create get requests for each URL
$mh = curl_multi_init();
foreach($urls as $i => $url)