Skip to content

Instantly share code, notes, and snippets.

View jawys's full-sized avatar

Jan Wystub jawys

  • Lower Rhine, Germany
  • 18:11 (UTC +02:00)
View GitHub Profile
@jawys
jawys / readme.md
Last active July 27, 2023 12:24
craftcms docker entrypoint misused?

Look at this. Entrypoint was used quite offensive:

❯ docker run --rm -it craftcms/nginx:8.1 sh
Error: positional arguments are not supported: ['sh']
For help, use /usr/bin/supervisord -h

I have to override the entrypoint to get a simple shell working:

❯ docker run --rm -it --entrypoint '' craftcms/nginx:8.1 sh
/app $ echo hello
/app $ php craft install
Username: [admin]
Email: dev@example.org
Password:
Confirm:
Site name: [German]
Site URL: [$PRIMARY_SITE_URL]
Site language: [de]
*** installing Craft
> create table {{%announcements}} ... done (time: 0.111s)
@jawys
jawys / disableApplePressAndHoldVSCode.sh
Created May 14, 2019 18:26
Disable ApplePressAndHold for VSCode
#! /bin/bash
defaults write com.microsoft.VSCode ApplePressAndHoldEnabled -bool false
@jawys
jawys / .js
Created June 14, 2017 13:43
Does it make sense to compare a string with the aid of an array rather than '===' it more times with '||' in terms of performance?
(function arrayAidedCompare (compareString) {
console.time('or')
console.log(compareString === 'A' || compareString === 'B')
console.timeEnd('or')
console.time('array')
console.log(['A', 'B'].indexOf(compareString) !== -1)
console.timeEnd('array')
})('A')