Skip to content

Instantly share code, notes, and snippets.

View davidpiesse's full-sized avatar

David Piesse davidpiesse

View GitHub Profile
@davidpiesse
davidpiesse / Foreach-refactor.php
Created July 29, 2016 07:30
A refactoring challenge for Adam Wathan at Laracon 2016
//this function returns entrymessage objects only if the entrymessage is a mesaage, and the internal message object isText.
//From Facebook messenger api
//Got parts refractories but couldn't work out how to return a collection of valid entrymessages with the double foreach.
//Tried lots of combos of each/map/ and filter.
public function textMessages()
{
$result = [];
foreach ($this->entries as $entry) {
foreach ($entry->messages as $entryMessage) {
@davidpiesse
davidpiesse / gist:572d4aa272fdbaccfd49423b3cf699fc
Created May 25, 2017 10:27
Bash script for adding common packages when building a new laravel project
//Asks a bunch of questions about potential common packages that you may want to add
//Example
laravel new test-project
//It runs
laravelextras
//Asks questions
There are 27 potential packages you may want to add to your composer file. Select y/n for all of the following.
Once complete composer will install all of these packages with the latest version if not defined in the list of packages
@davidpiesse
davidpiesse / info.md
Last active January 31, 2018 15:55
Earthquake Stream Connection - Pusher
@davidpiesse
davidpiesse / vue-switch-style
Created March 1, 2017 14:52
VueJS Switch Custom Style - SASS to CSS conversion
.vue-switcher-theme--custom.vue-switcher-color--green div {
background-color: #C8E6C9;
}
.vue-switcher-theme--custom.vue-switcher-color--green div:after {
background-color: #43A047;
}
.vue-switcher-theme--custom.vue-switcher-color--green.vue-switcher--unchecked div {
background-color: #E0E0E0;
}
.vue-switcher-theme--custom.vue-switcher-color--green.vue-switcher--unchecked div:after {
@davidpiesse
davidpiesse / example.js
Created July 8, 2018 18:33
A auto loader that allows for loading modules quickly with an await function and then call anywhere else (Allows you to get out the the UMD function)
import esri from '../moduleLoader'
async loaded(){
await esri.loadModules([
'esri/Map',
'esri/views/MapView',
'esri/widgets/Compass',
],true)
}
@davidpiesse
davidpiesse / index.js
Created August 5, 2019 13:59
Brand Colour Tailwind Plugin
let brands = {
"500px": {
"title": "500px",
"slug": "500px",
"colors": ["0099e5", "ff4c4c", "34bf49"]
},
"about-me": {
"title": "About.me",
"slug": "about-me",
"colors": ["00a98f"]
@davidpiesse
davidpiesse / wiffle.md
Created May 29, 2020 16:32
Wiffle Ball - Pandemic Style

6 man Wiffleball

  • Pandemic safe Wiffleball

Equipment

  • Hand & Equipment Sanitizer
  • 2 Wiffle balls
  • 2 Wiffle bats
  • Wiffle Strike Zone (see https://www.youtube.com/watch?v=eGXfNZhg9vw )
  • Fence Markers (Could be poles, cones etc.) Ideally two high Viz fence markers and some cones
@davidpiesse
davidpiesse / tailwind_md_colours.js
Last active November 30, 2020 21:35
Replace the default (still great) colors from Tailwind to those from Material Design maintaining the Tailwind naming convention
//Notes
//
//For mapping the 100-900 colors we have mapped as follows:
//darkest:900
//darker:700
//dark:600
//base:500
//light:400
//lighter:300
//lightest:100
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.