This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Deploy to Staging | |
on: | |
push: | |
branches: [ develop ] | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import http from 'k6/http'; | |
import { check } from "k6"; | |
import { Rate } from "k6/metrics"; | |
export let errorRate = new Rate("errors"); | |
export let options = { | |
thresholds: { | |
errors: ["rate<0.1"] // <10% errors | |
} | |
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
:root { | |
--channel-nav-item-height: 1.5rem; | |
--message-max-width: 50rem; | |
--theme-light-message-color: #23262a; | |
--avatar-border-radius: 3px; | |
--server-border-radius: 8px; | |
--sidebar-width: 180px; | |
--breakpoint: 1100px; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Apache configuration file | |
# httpd.apache.org/docs/2.2/mod/quickreference.html | |
# Note .htaccess files are an overhead, this logic should be in your Apache | |
# config if possible: httpd.apache.org/docs/2.2/howto/htaccess.html | |
# Techniques in here adapted from all over, including: | |
# Kroc Camen: camendesign.com/.htaccess | |
# perishablepress.com/press/2006/01/10/stupid-htaccess-tricks/ | |
# Sample .htaccess file of CMS MODx: modxcms.com | |
# This is the free sample of .htaccess from 6GO s.r.l. | |
# @author Claudio Ludovico Panetta (@Ludo237) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* How to create an ElementIndex via custom Record for Craft CMS 3.x | |
* | |
* @copyright Copyright (c) 2018 anubarak | |
*/ | |
namespace modules\mymodule\elements\db; | |
use craft\base\Element; | |
use craft\db\Query; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1. Rename the GitHub.com repo to change `craft3-` to `craft-` | |
2. Pull all changes down, then duplicate `master` naming it `v1`, or `v2` or whatever | |
3. Push the new versioned branch to remote | |
4. On Github, click on Settings->Branches and change the default repo | |
5. On Github click on Branches from the main page, and delete the `master` branch | |
6. Delete `master` in your local repo | |
7. Search through your project and change all instances of `craft3-` to `craft-` | |
8. Update your `docs` URL and `changelogUrl` to point to the new repo/branch | |
9. Bump the version number in `composer.json` and `CHANGELOG.md` | |
10. Push all of the changes with your normal gitflow release cycle |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#301 Redirects for .htaccess | |
#Redirect a single page: | |
Redirect 301 /pagename.php http://www.domain.com/pagename.html | |
#Redirect an entire site: | |
Redirect 301 / http://www.domain.com/ | |
#Redirect an entire site to a sub folder | |
Redirect 301 / http://www.domain.com/subfolder/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
class CraftValetDriver extends ValetDriver | |
{ | |
/** | |
* Determine if the driver serves the request. | |
* | |
* @param string $sitePath | |
* @param string $siteName | |
* @param string $uri |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
LOCAL_PARALLEL_JOBS=$1 | |
PARALLEL_JOBS=${LOCAL_PARALLEL_JOBS:-4} | |
# parallel creates a subshell, which will use the default $SHELL | |
# This makes sure php runs paralell with the correct shell | |
export SHELL=/bin/bash | |
index() { | |
echo Indexing $1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
public function createProduct ($locale = null) | |
{ | |
if ( !$this->productTypes ) { | |
$this->productTypes = craft()->commerce_productTypes->getAllProductTypes(); | |
} | |
if ( !$locale ) { | |
$locale = craft()->i18n->getPrimarySiteLocaleId(); |