Skip to content

Instantly share code, notes, and snippets.

View davidyell's full-sized avatar
🧙‍♂️
Weaving wondrous wisps

David Yell davidyell

🧙‍♂️
Weaving wondrous wisps
  • Senior Software Engineer
  • Southampton, Hampshire, UK
  • 01:36 (UTC +01:00)
View GitHub Profile
@crot4lus
crot4lus / UK Bank Holidays.csv
Created November 14, 2016 08:40
CSV with MySQL friendly UK bank holidays
Name Bank Holiday Date
New Year's Day 1 2009-01-01
Robert Burns Night (Burns Night) 0 2009-01-25
Holocaust Memorial Day 0 2009-01-27
Valentines Day 0 2009-02-14
Shrove Tuesday (Pancake Day) 0 2009-02-24
Ash Wednesday 0 2009-02-25
St David's Day 0 2009-03-01
St Patricks Day 0 2009-03-17
Mothering Sunday (Mothers Day) 0 2009-03-22
@slouma2000
slouma2000 / vuejs-filter-limit.txt
Last active September 9, 2019 13:25
Vuejs Filter Limit
Vue.filter('limit', function(array, length) {
var limitCount = parseInt(length, 10);
if (limitCount <= 0) {
("development") !== 'production' && _.warn(
'The limit filter requires an argument defining the limit count.'
);
return array;
}
return array.slice(0, limitCount);
});
<?php
namespace App\Model\Table;
trait saveAllTrait {
public function saveAll($entities = [], $options = null) {
if($options === null) {
return array_map([$this, 'save'], $entities);
}
$saved_entities = [];
@AD7six
AD7six / bench.php
Created August 15, 2013 09:36
Is is_null still slow?
<?php
$null = null;
$notNull = 123;
$is_null = function($value) {
for($i = 0; $i < 1000000; $i++) {
$result = is_null($value);
}
return "is_null";
};
@alefteris
alefteris / smartgit.desktop
Created April 30, 2012 18:52
Smartgit desktop file for use with Ubuntu Unity launcher
#!/usr/bin/env xdg-open
[Desktop Entry]
Version=1.0
Type=Application
Terminal=false
StartupNotify=true
Name=Smartgit
Exec=env SMARTGIT_JAVA_HOME=/opt/apps/jre7/ /opt/apps/smartgit/bin/smartgit.sh
Icon=/opt/apps/smartgit/bin/smartgit-64.png
@badsyntax
badsyntax / labelled_marker.js
Created April 12, 2012 09:45
Google Maps V3 Labelled Marker
/*
* An example of how to use a Google Map overlay to display a label on top of marker.
* This is a slight re-work of http://www.tdmarketing.co.nz/blog/2011/03/09/create-marker-with-custom-labels-in-google-maps-api-v3/
* I suggest you rather view that blog post, this code is pasted here purely for my own personal reference.
*/
var
point = {
lat: 37.8478115,
long: 15.2934327
@lucasfais
lucasfais / gist:1207002
Created September 9, 2011 18:46
Sublime Text 2 - Useful Shortcuts

Sublime Text 2 – Useful Shortcuts (Mac OS X)

General

⌘T go to file
⌘⌃P go to project
⌘R go to methods
⌃G go to line
⌘KB toggle side bar
⌘⇧P command prompt
@josegonzalez
josegonzalez / readme.md
Last active November 17, 2018 16:16
Example Readme for CakePHP plugins that use MIT license

[PLUGIN NAME] Plugin

[ONE LINE DESCRIPTION OF PROJECT]

Background

[A PARAGRAPH DESCRIBING WHY YOU BUILT THIS]

[ANOTHER PARAGRAPH DESCRIBING YOUR IMPETUS FOR RELEASING THIS]

@tjlytle
tjlytle / imageColor.php
Created November 17, 2009 19:19
Class to find 'average' image color.
<?php
/**
* imageColor
*
* Shows three methods to find the 'average' image color.
*
* Each function expects a gd image object.
*
* imageColor::averageResize($image) resizing to 1px, and checking the color.
* imageColor::averageBorder($image) find the average color of all border pixels.