Skip to content

Instantly share code, notes, and snippets.

View matrunchyk's full-sized avatar
🇺🇦
If you want to go fast, go alone. If you want to go far, bring others along.

Serhii Matrunchyk matrunchyk

🇺🇦
If you want to go fast, go alone. If you want to go far, bring others along.
View GitHub Profile
@matrunchyk
matrunchyk / OpenCart update script
Last active October 14, 2015 21:38
Use: update.sh /absolute/path/of/your/OpenCart/installation. Read this post for details: http://easywebthings.blogspot.com/2015/10/opencart-upgrade-script.html
#!/bin/bash
RED='\033[0;31m'
YELLOW='\033[0;33m'
GREEN='\033[0;32m'
NC='\033[0m' # No Color
dest=$1
keep_local=(
@matrunchyk
matrunchyk / OCMod "Custom Model Support"
Created October 15, 2015 09:50
Adds a support for custom OpenCart models
<?xml version="1.0" encoding="utf-8"?>
<modification>
<name>Custom Model Support</name>
<code>custom_model_support</code>
<version>1.0</version>
<author>Sergii Matrunchyk</author>
<link>mailto: [email protected]</link>
<file path="system/engine/loader.php">
<operation>
<search trim="true"><![CDATA[
@matrunchyk
matrunchyk / loader.php
Last active October 15, 2015 09:58
Proposal for OpenCart guys
<?php
// ...
public function model($model, $data = array()) {
// $this->event->trigger('pre/model/' . str_replace('/', '.', (string)$model), $data);
$model = str_replace('../', '', (string)$model);
/* <custom_model_support> */
diff --git a/actions/admin/settings/131.ssl.php b/actions/admin/settings/131.ssl.php
index 016de80..113de12 100644
--- a/actions/admin/settings/131.ssl.php
+++ b/actions/admin/settings/131.ssl.php
@@ -40,6 +40,15 @@ return array(
'default' => 'ECDH+AESGCM:ECDH+AES256:!aNULL:!MD5:!DSS:!DH:!AES128',
'save_method' => 'storeSettingField',
),
+ 'system_ssl_letsencrypt_path' => array(
+ 'label' => $lng['serversettings']['ssl']['ssl_letsencrypt_path'],
@matrunchyk
matrunchyk / ThemeView.php
Last active May 18, 2016 19:00
ThemeView Decorator
<?php
class ThemeView
{
private $args;
private $file;
public function __get($name)
{
return $this->args[$name];
<?php
public function renderSamplePage($data) {
$view = new \ThemeView('sample_page', $data);
$view->render();
}
@matrunchyk
matrunchyk / # php70 - 2016-09-12_13-54-43.txt
Created September 12, 2016 11:01
php70 (homebrew/php/php70) on Mac OS X 10.12 - Homebrew build logs
Homebrew build logs for homebrew/php/php70 on Mac OS X 10.12
Build date: 2016-09-12 13:54:43
Route::get('/js/lang.js', function () {
$lang = config('app.locale');
$files = glob(resource_path('lang/' . $lang . '/*.php'));
$strings = [];
foreach ($files as $file) {
$name = basename($file, '.php');
$strings[$name] = require $file;
}
@matrunchyk
matrunchyk / karma.conf.js
Last active March 27, 2017 22:46
Laravel + VueJS + Karma
const webpackConfig = require('../../../../../node_modules/laravel-mix/setup/webpack.config');
// const path = require('path');
// safari >=4
// no need for app entry during tests
delete webpackConfig.entry;
module.exports = (config) => {
// noinspection ES6ConvertVarToLetConst
@matrunchyk
matrunchyk / index.js
Created March 27, 2017 22:44
Laravel + VueJS + Karma
// This file is specified to load ing karma.conf.js (Files section)
// @see https://gist.github.com/matrunchyk/a79accea739f586074e005e0542200ea
//
// Polyfill fn.bind() for PhantomJS
/* eslint-disable no-extend-native */
// Function.prototype.bind = require('function-bind');
require('babel-polyfill');
// require all test files (files that ends with .spec.js)
const testsContext = require.context('./specs', true, /\.spec$/);