Skip to content

Instantly share code, notes, and snippets.

View starckio's full-sized avatar
🍼
Baby boy !

Christopher Boutillé starckio

🍼
Baby boy !
View GitHub Profile
@andyferra
andyferra / github.css
Created April 30, 2012 02:11
Github Markdown CSS - for Markdown Editor Preview
body {
font-family: Helvetica, arial, sans-serif;
font-size: 14px;
line-height: 1.6;
padding-top: 10px;
padding-bottom: 10px;
background-color: white;
padding: 30px; }
body > *:first-child {
@lennardv2
lennardv2 / 1. Building PHP-MAMP on Apple Silicon M1.md
Last active February 29, 2024 07:57
Native PHP development / MAMP stack on Apple silicon M1

Building the MAMP stack (php, apache & mysql) on Apple Silicon ARM (native)

Update! This tutorial is outdated. Nowadays brew installes m1 binaries just fine. Also use valet: https://laravel.com/docs/9.x/valet. It's 10x easier.

In this tutorial, we'll build the the nescessary packages for ARM via homebrew. After that we'll configure apache2 for using virtual hosts. The native php is ofcourse way faster, see the results of this benchmark below.

TEST NAME SECONDS OP/SEC
<?php
// get the post UID from the URL
$uid = param('post');
if(!$uid) die(a::json(array(
'status' => 'error',
'msg' => 'The post could not be found',
)));
@zulhfreelancer
zulhfreelancer / send_email_on_mac_mamp_hotmail.md
Last active January 16, 2023 10:22
How to send e-mail on Mac using MAMP (not PRO version) and Hotmail SMTP

How to send e-mail on Mac using MAMP (not PRO version) and Hotmail SMTP

Requirements

  1. A Mac running OSX 10.11.6
  2. MAMP v3.5
  3. PHP 7.0.0 (comes inside the MAMP v3.5 above)

Note

@bastianallgeier
bastianallgeier / statify.php
Last active October 4, 2022 17:12
A first draft for a script, which converts a Kirby site into a static site. It's a rough first draft, so don't expect it to be perfect. Play with it, if you like it!
<?php
/**
* Instructions:
*
* 1. Put this into the document root of your Kirby site
* 2. Make sure to setup the base url for your site correctly
* 3. Run this script with `php statify.php` or open it in your browser
* 4. Upload all files and folders from static to your server
* 5. Test your site
@bastianallgeier
bastianallgeier / controllers--contact.php
Created October 1, 2014 19:36
Plain contactform example for Kirby 2
<?php
return function($site, $pages, $page) {
$alert = null;
if(get('submit')) {
$data = array(
'name' => get('name'),
@bastianallgeier
bastianallgeier / routes.php
Last active July 27, 2017 19:04
Sample route setup for Kirby 2
<?php
c::set('routes', array(
array(
'pattern' => 'projects/old-project-url-for-project-a',
'action' => function() {
go('projects/project-a');
}
),
array(
<?php if($folder = page('clients/' . $site->user(get('username')))): ?>
The folder exists
<?php else: ?>
The folder does not exist
<?php endif ?>
<meta name="description" content="<?php echo $page->description()->or($site->description()) ?>">
git submodule add https://github.com/getkirby/kirby.git
git submodule add https://github.com/getkirby/panel.git
git submodule update --init --recursive