Skip to content

Instantly share code, notes, and snippets.

View jelicanin's full-sized avatar

Milan Jelicanin jelicanin

View GitHub Profile
@robingram
robingram / FluentMigrationTask.php
Last active July 17, 2019 12:08
A work in progress script to automate migration from Silverstripe Fluent v3 to v4.
<?php
namespace TractorCow\Fluent\Task;
use SilverStripe\Core\ClassInfo;
use SilverStripe\Core\Config\Config;
use SilverStripe\Dev\BuildTask;
use SilverStripe\ORM\Connect\DatabaseException;
use SilverStripe\ORM\DataObject;
use SilverStripe\ORM\DB;
use TractorCow\Fluent\Extension\FluentExtension;
@mlewis-everley
mlewis-everley / PermissableGridField.php
Last active November 21, 2022 02:58
Version of SilverStripe GridField that checks canView permissions before handing records over to components
<?php
namespace App\Forms\GridField;
use SilverStripe\ORM\SS_List;
use SilverStripe\Forms\GridField\GridField;
use SilverStripe\Forms\GridField\GridField_DataManipulator;
/**
* Custom gridfield that applies canView permissions to list before manipulation
<?php
/**
* Action that takes the user back to a given link rather than submitting
* the form.
*
* @package cancelformaction
*/
class CancelFormAction extends FormAction
{
esphome:
name: shade
platform: ESP8266
board: d1_mini
wifi:
ssid: !secret wifi
password: !secret wifi_pw
# Enable logging
##
## How to install mcrypt in php7.2 / php7.3
## Linux / MacOS / OSX
##
## https://lukasmestan.com/install-mcrypt-extension-in-php7-2/
#
<?php
class MagicManyManyList extends ManyManyList
{
/**
* @var array
*/
protected static $join_table_relation_mapping = [];
/**
@bummzack
bummzack / deploy-stages.php
Last active April 26, 2021 22:06
Rsync Deployment setup à la bummzack
<?php
server('live', '{{LiveServer}}', 22)
->user('{{SshUser}}')
->forwardAgent() // You can use identity key, ssh config, or username/password to auth on the server.
->stage('live')
->env('deploy_path', '{{DeployDir}}'); // Define the base path to deploy your project to.
server('staging', '{{StagingServer}}', 22)
->user('{{SshUser}}')
->forwardAgent() // You can use identity key, ssh config, or username/password to auth on the server.
@andrewstobbe
andrewstobbe / MacOSXSierra:Brew+Apache+Mysql+PHPSwitcher+DNSMasq+SSL.md
Last active July 19, 2021 02:12
Mac OSX Sierra : Brew Apache + Mysql + PHP Switcher + DNSMasq + SSL

Mac OSX Sierra : Brew Apache + Mysql + PHP Switcher + DNSMasq + SSL 👍

Things I had to do using Homebrew to get my local web dev environment back up and running after migration to OSX Sierra + Xcode 8.1.

Note: I used brew reinstall because I had already installed most of this previously under Yosemite. Probably better ways to do this, but this is what worked for me.

brew doctor

brew tap homebrew/dupes
brew tap homebrew/versions
{
"SASS_SRC" : "./themes/mytheme/dev-sass",
"CSS_DIR" : "./themes/mytheme/css",
"PROXY_URL" : "localhost/mysite",
"JS_SRC" : "./themes/mytheme/dev-javascript",
"JS_DST" : "./themes/mytheme/javascript",
"JS_FILES" : [
"node_modules/picturefill/dist/picturefill.js",
"node_modules/jquery/dist/jquery.js",
"./themes/mytheme/dev-javascript/init.js"
@mpneuried
mpneuried / Makefile
Last active May 4, 2024 13:46
Simple Makefile to build, run, tag and publish a docker containier to AWS-ECR
# import config.
# You can change the default config with `make cnf="config_special.env" build`
cnf ?= config.env
include $(cnf)
export $(shell sed 's/=.*//' $(cnf))
# import deploy config
# You can change the default deploy config with `make cnf="deploy_special.env" release`
dpl ?= deploy.env
include $(dpl)