Skip to content

Instantly share code, notes, and snippets.

View meigwilym's full-sized avatar

Mei Gwilym meigwilym

View GitHub Profile
@meigwilym
meigwilym / jq-mobile-green-button-theme.css
Created March 1, 2012 23:12 — forked from mastergizmo/jq-mobile-green-button-theme.css
jQuery Mobile Green Theme for Buttons
.ui-btn-up-g, .ui-btn-hover-g, .ui-btn-down-g
{
color: white;
font-weight: bold;
text-decoration: none;
}
.ui-btn-up-g a.ui-link-inherit {
color: #fff;
}
@meigwilym
meigwilym / macros
Created April 3, 2014 09:14 — forked from mnshankar/macros
<?php
/*********************************************************************************************
* Example usage (In view)
* <div class="welcome">
<?php echo Form::open(array('route'=>'process','class'=>'form-horizontal'))?>
<?php echo Form::textField('first_name')?>
<?php echo Form::textField('last_name')?>
<?php echo Form::emailField('email')?>
<?php echo Form::passwordField('password')?>
<?php echo Form::selectField('select_one', array('1'=>'abc', '2'=>'def'))?>
@meigwilym
meigwilym / config.yaml
Created December 23, 2016 09:47
Puphpet config YAML file
vagrantfile:
target: local
vm:
provider:
local:
box: puphpet/centos7-x64
box_url: puphpet/centos7-x64
box_version: '0'
chosen_virtualizer: virtualbox
virtualizers:
@meigwilym
meigwilym / provision.sh
Last active August 16, 2023 19:51
RedHat 7.3 setup Nginx, PHP 7.1, MySQL 5.7, Composer, Supervisor. For Laravel installations.
#!/bin/bash
# setup an environment for laravel on Red Hat 7.3
# Nginx
# PHP 7.1
# optional MySQL 5.7 or PostgreSQL 9.6
# Composer
# Supervisor
# check for root user
@meigwilym
meigwilym / console.php
Last active March 5, 2024 02:20
Laravel Create User Command
<?php
// routes/console.php
// quickly create an user via the command line
Artisan::command('user:create', function () {
$name = $this->ask('Name?');
$email = $this->ask('Email?');
$pwd = $this->ask('Password?');
// $pwd = $this->secret('Password?'); // or use secret() to hide the password being inputted
\DB::table('users')->insert([
@meigwilym
meigwilym / example.conf
Last active May 9, 2018 10:03
Install a web server and separate database server for Wordpress
server {
# certbot uses this to verify the SSL request
location ^~ /.well-known/acme-challenge/ {
default_type "text/plain";
root /var/www/letsencrypt;
}
}
@meigwilym
meigwilym / laravel-check.php
Created April 5, 2018 13:20
A PHP file that checks that your server is compatible with Laravel 5.6's requirements.
<?php
$phpversionok = false;
if(PHP_VERSION_ID >= 70103) {
$phpversionok = true;
}
$exts = ['openssl', 'pdo', 'mbstring', 'tokenizer', 'xml', 'ctype', 'json'];
$extsNotloaded = [];
foreach($exts as $i => $extension) {
@meigwilym
meigwilym / readme.md
Last active July 6, 2018 12:45
Using Adminator in Laravel

Using Adminator in Laravel

Adminator is not that friendly to be dropped in a Laravel project. Here's what I did to get the CSS and fonts working.

Using Laravel 5.6 and Adminator

@meigwilym
meigwilym / acenion.md
Last active August 31, 2018 10:24
Acenion y Gymraeg

Pob llythyren acenog yn y Gymraeg.

Mae'r degol, hex a named ar gyfer dogfennau html.

Llythyren Côd Disgrifiad Decimal Hex Named
 U+00C2 LATIN CAPITAL LETTER A WITH CIRCUMFLEX &#194; &#xc2; &Acirc;
â U+00E2 LATIN SMALL LETTER A WITH CIRCUMFLEX &#226; &#xe2; &acirc;
Ê U+00CA LATIN CAPITAL LETTER E WITH CIRCUMFLEX &#202; &#xca; &Ecirc;
ê U+00EA LATIN SMALL LETTER E WITH CIRCUMFLEX &#234; &#xea; &ecirc;
@meigwilym
meigwilym / readme.md
Last active September 26, 2018 09:31
Use array functions rather than loops for JSON objects

Use array functions rather than loops for JSON objects

Take this array of tag objects for example.

const tags = [
	{
		name: 'Studio',
		id: 'studio',
 url: '/tags/studio'