Skip to content

Instantly share code, notes, and snippets.

View tommyskott's full-sized avatar
👨‍💻
Swedish Freelancer

Tommy Borgenfalk Skott tommyskott

👨‍💻
Swedish Freelancer
View GitHub Profile
@tommyskott
tommyskott / autoloader.php
Last active June 21, 2022 09:37
Require WordPress mu-plugins in vanilla wp projects.
<?php
/*
Plugin Name: B&S Autoloader
Plugin URI: https://github.com/borgenfalkskott
Description: Mu-plugin autoloader for vanilla Wp.
Version: 1.1.0
Author: Borgenfalk & Skott
Author URI: https://borgenfalk.se
License: MIT
*/
@sindresorhus
sindresorhus / esm-package.md
Last active July 6, 2024 09:11
Pure ESM package

Pure ESM package

The package that linked you here is now pure ESM. It cannot be require()'d from CommonJS.

This means you have the following choices:

  1. Use ESM yourself. (preferred)
    Use import foo from 'foo' instead of const foo = require('foo') to import the package. You also need to put "type": "module" in your package.json and more. Follow the below guide.
  2. If the package is used in an async context, you could use await import(…) from CommonJS instead of require(…).
  3. Stay on the existing version of the package until you can move to ESM.
@fraktalize
fraktalize / deployscript.sh
Created June 8, 2020 19:14
Deployscript for intializing file structure for shared CI hosting
mkdir -p {staging,production}/deploys
mkdir -p shared/{staging,production,uploads}
wget https://raw.githubusercontent.com/roots/bedrock/master/.env.example -O shared/staging/.env
wget https://raw.githubusercontent.com/roots/bedrock/master/.env.example -O shared/production/.env
@Johannestegner
Johannestegner / password5.txt
Created February 7, 2020 10:48
My seecret passwords, please dont read!
lozzzzzzzz123123
# I only use 1 password.
@tommyskott
tommyskott / apache-file-permissions.md
Last active May 23, 2022 18:10
Apache file permissions

Apache file permissions

Change owner:group recursively on everything in path

sudo chown -R www-data:www-data .

Change all the directories to 755 (drwxr-xr-x)

sudo find . -type d -exec chmod 755 {} \;
@ekandreas
ekandreas / deploy.php
Last active August 16, 2018 13:10
Ultimate WordPress PHP deployer file for Swedish site
<?php
namespace Deployer;
require 'recipe/composer.php';
set('repository', 'path-to-repo');
set('git_tty', true);
set('shared_files', ['.env','web/.htaccess']);
set('shared_dirs', ['web/app/uploads']);
@QWp6t
QWp6t / BedrockMultisiteValetDriver.php
Last active June 17, 2024 07:43
Fix Laravel Valet when using WordPress subdirectory multisite + Bedrock
<?php
namespace Valet\Drivers\Custom;
class BedrockMultisiteValetDriver extends \Valet\Drivers\Specific\BedrockValetDriver
{
/**
* Determine if the incoming request is for a static file.
*
* @return string|false
@khromov
khromov / deploy.php
Last active March 10, 2020 15:27
Deploying WordPress with Deployer 4
<?php
namespace Deployer;
require 'recipe/common.php';
set('ssh_type', 'native');
set('ssh_multiplexing', true);
// Set configurations
set('repository', 'git@github.com:user/repo.git');
@jjjjcccjjf
jjjjcccjjf / git-cheat-sheet.md
Last active October 14, 2022 09:47
GIT CHEAT SHEET by TOWER - www.git-tower.com

CREATE

Clone an existing repository

$ git clone ssh://user@domain.com/repo.git

Create a new local repository

$ git init

LOCAL CHANGES

@Johannestegner
Johannestegner / IconGeneration.jsx
Last active August 29, 2015 14:07 — forked from twonjosh/Create iOS Icons.jsx
Photoshop script that generates Icons for Android and iOS devices.
/**
* Small script to generate icons for Android and iOS -devices.
*
* Copyrights:
* Copyright (c) 2010 Matt Di Pasquale (https://gist.github.com/mattdipasquale/711203)
* Added tweaks Copyright (c) 2012 by Josh Jones http://www.appsbynight.com (https://gist.github.com/appsbynight/3681050)
* Code cleanup, rewrite, minor buggfixing, addition of android icons and generation of the folders by Johannes Tegnér http://jite.eu
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal