Skip to content

Instantly share code, notes, and snippets.

Avatar

WhereJuly WhereJuly

  • Moscow, Russia
View GitHub Profile
@WhereJuly
WhereJuly / composer.json
Last active Aug 18, 2022
Standalone Laravel 8.25 validation with genuine Laravel messages
View composer.json
// ...some entries
"require": {
"illuminate/validation": "^8.25",
"illuminate/translation": "^8.25"
}
// ...some more entries
@WhereJuly
WhereJuly / error.log
Created Jan 16, 2021
OpenCart v3.0.3.6 error log for Twig issue
View error.log
// See the issue here https://github.com/opencart/opencart/issues/8103#
2021-01-16 13:57:24 - MOD: Modification Default
FILE: system/engine/action.php
REGEX: ~(require|include)(_once)?\(([^)]+)~
LINE: 69
FILE: system/engine/loader.php
REGEX: ~(require|include)(_once)?\(([^)]+)~
View Vue CLI + Twig templates vue.config.js
// The issue solved with this config is `twig-loader` and Webpack process the image assets
// referenced in `.twig` templates the correct way.
// Namely as a build process result, the images are copied to `.dist` folder with hashed names,
// the `src` images' attributes in the output HTML file produced from the Twig templates
// are updated with the respective hashed names.
module.exports = {
runtimeCompiler: true,
outputDir: '.dist',
@WhereJuly
WhereJuly / gulpfile.js
Created May 26, 2020
Development environment live reload Gulp task for Adonis 4.1.0 full-stack project with Browsersync
View gulpfile.js
// In fact can be used for every web project that needs live reload for dev environment.
// The accompanying guide is here:
// https://github.com/adonisjs/core/issues/1234#issuecomment-633937899
'use strict';
const gulp = require('gulp'),
browserSync = require('browser-sync').create();
const config = {
@WhereJuly
WhereJuly / BasicAPITest.spec.js
Last active Sep 14, 2020
Mocha test with `async/await` vs `done` approaches
View BasicAPITest.spec.js
'use strict';
const assert = require("assert");
const chai = require("chai");
const chaiHttp = require("chai-http");
const server = require("../src/app");
// See the coupled Express server snippet here
// https://gist.github.com/WhereJuly/7b275ec75380505aa9db9a384f0e4ab3
@WhereJuly
WhereJuly / app.js
Last active May 9, 2020
Basic Express server serving a simplest app with server object exported for tests
View app.js
'use strict';
const app = require('express')();
app.get('/', (req, res) => {
res.status(200).json({ message: 'Connected!' });
});
// Turn on that server!
const server = app.listen(3000, () => {
@WhereJuly
WhereJuly / Export All Text Layers.jsx
Created Jan 21, 2017
Export All Text Layers.jsx
View Export All Text Layers.jsx
// https://github.com/keyboardface/photoshop-scripts
/*
*
* Export All Text Layers
* 1.1.4
* Pavel Ivanov
* https://github.com/pivanov/photoshop-scripts
*
*/
@WhereJuly
WhereJuly / Photoshop: TextExtract.jsx
Last active Dec 7, 2016
Photoshop: Really working text extract from PSD
View Photoshop: TextExtract.jsx
// modified by WhereJuly
// changed useDialog to false
// replaced filePath with opened psd's full path
/*
*
* TextExport 1.3 - by Bramus! - http://www.bram.us/
* text layer style export added by Max Glenister (@omgmog) http://www.omgmog.net
*
* v 1.x - ????.??.?? - UPD: HTML Output (?)
@WhereJuly
WhereJuly / Photoshop: zoom300.jsx
Last active Jun 17, 2022
Photoshop: script for zooming in
View Photoshop: zoom300.jsx
main();
function main(){
// Change the value between the parentheses below
// into your desired percentage:
setZoomLevel(300);
// Leave the code below unchanged
function setZoomLevel(zoom){
if(zoom < 1) zoom =1;