Skip to content

Instantly share code, notes, and snippets.

View seyfer's full-sized avatar
💭
pet the duck until exploded

Oleg Abrazhaev seyfer

💭
pet the duck until exploded
View GitHub Profile
@seyfer
seyfer / snippet of package.json scripts
Created February 4, 2021 17:26 — forked from educkf/snippet of package.json scripts
Sample Split Vue Config Files
"scripts": {
"serve": "vue-cli-service serve",
"build:admin": "rimraf vue.config.js && copy vue.configAdmin.js vue.config.js && vue-cli-service build --dest dist/admin src/admin/main.js && rimraf vue.config.js && copy vue.configDefault.js vue.config.js",
"build:client": "rimraf vue.config.js && copy vue.configClient.js vue.config.js && vue-cli-service build --dest dist/client src/client/main.js && rimraf vue.config.js && copy vue.configDefault.js vue.config.js",
"lint": "vue-cli-service lint"
},
@seyfer
seyfer / upload.js
Created June 25, 2021 10:24 — forked from ibreathebsb/upload.js
file upload from dataUrl with axios
// Note: only for modern browser
import axios from 'axios'
// helper function: generate a new file from base64 String
const dataURLtoFile = (dataurl, filename) => {
const arr = dataurl.split(',')
const mime = arr[0].match(/:(.*?);/)[1]
const bstr = atob(arr[1])
let n = bstr.length
const u8arr = new Uint8Array(n)
@seyfer
seyfer / download.php
Created August 2, 2021 15:08 — forked from nicklasos/download.php
Curl PHP multiple files downloading
<?php
function multiple_download(array $urls, $save_path = '/tmp')
{
$multi_handle = curl_multi_init();
$file_pointers = [];
$curl_handles = [];
// Add curl multi handles, one per file we don't already have
foreach ($urls as $key => $url) {
@seyfer
seyfer / Dockerfile
Created May 18, 2022 17:45 — forked from Raistlfiren/Dockerfile
XDebug 3 and Docker Reference
FROM php:7.4-cli-alpine
# Install xdebug
RUN apk add --no-cache --virtual .phpize-deps $PHPIZE_DEPS \
&& pecl install xdebug \
&& docker-php-ext-enable xdebug \
&& apk del .phpize-deps
WORKDIR /var/www/html