Skip to content

Instantly share code, notes, and snippets.

View matthojo's full-sized avatar

Matthew Harrison-Jones matthojo

View GitHub Profile
@matthojo
matthojo / Emoji Shortcuts.ahk
Created November 2, 2018 13:02
AutoHotkey script to expand Emojis based on popular application shortcuts 🎉
;------------------------------------------------------------------------------
; Changelog
;------------------------------------------------------------------------------
;
; 02/11/2018 - Initial creation
;
;------------------------------------------------------------------------------
; Settings
;------------------------------------------------------------------------------
#NoEnv ; For security
@matthojo
matthojo / pre-commit
Last active June 19, 2018 14:27
Format JS and JSX code with `prettier-standard` on commit
#!/bin/sh
#
# A hook script to format JS and JSX files wth 'prettier-standard'.
# Called by "git commit" with no arguments.
#
# If formatting causes an empty commit, the commit will abort (`exit 1`).
#
# FAQ
# ====
#
@matthojo
matthojo / gist:8acc30c03317883c71ae
Last active August 29, 2015 14:17
Atom Packages
@matthojo
matthojo / Base16 Tomorrow Night Slack Theme
Last active July 28, 2016 21:54
Base16 Tomorrow Night Slack Theme
#191A1C,#282A2E,#B6BC68,#FFFFFF,#363B41,#959896,#80A2BE,#C26161
@matthojo
matthojo / gist:08d4426728271e628bc8
Last active August 29, 2015 14:04
Show months in order from current month.
<select class="ec-simple-select selectized js-month-select" name="select-month" placeholder="Select an month" tabindex="-1" style="display: none;">
<?php
for ($i=5; $i >= 1; $i--) {
echo '<option value="'.base_url().'events/bookings/'.((($current_month-$i) <= 0) ? ($current_year-1) : $current_year ).'/'.((($current_month-$i) <= 0) ? (12 + ($current_month-$i)) : ($current_month-$i)).'" >'.date('F', strtotime('01-'.((($current_month-$i) <= 0) ? (12 + ($current_month-$i)) : ($current_month-$i)).'-'.$current_year)).' '.((($current_month-$i) <= 0) ? ($current_year-1) : $current_year ).'</option>';
}
?>
<option value="<?php echo base_url();?>events/bookings/<?php echo $current_year;?>/<?php echo $current_month;?>" selected="selected"><?php echo date('F', strtotime('01-'.$current_month.'-'.$current_year));?> <?php echo ($this->uri->segment(3)) ? $this->uri->segment(3) : $current_year;?></option>
<?php
for ($i=1; $i <= 6; $i++) {
echo '<option value="'.b
@matthojo
matthojo / gist:b4fa7f2614f5a2a7f937
Created May 20, 2014 16:31
CalendarFull stop overlapping events
function isOverlapping (event){
// "calendar" on line below should ref the element on which fc has been called
var array = calendar.fullCalendar('clientEvents');
for(var i in array){
if(event._id !== undefined && array[i]._id == event._id) {
continue
} else {
var arrayEnd = ((array[i].end === null) ? array[i].start.clone().add('days', 1) : array[i].end)
, eventEnd = ((event.end === null) ? event.start.clone().add('days', 1) : event.end)
@matthojo
matthojo / gist:9745135
Created March 24, 2014 17:36
IE9 Select box hack
// Fix for IE9 not hiding select box arrow
.select-container
position relative
z-index 0
&:after
position absolute
right 1px
top 1px
content ''
@matthojo
matthojo / Package Controls.sublime-settings
Created March 1, 2014 16:52
Sublime Text preferences
{
"dictionary": "Packages/Language - English/en_GB.dic",
"installed_packages":
[
"Base16 Color Schemes",
"ColorPicker",
"Git",
"GitGutter",
"Inc-Dec-Value",
"Jade",
@matthojo
matthojo / gist:9095012
Created February 19, 2014 16:00
Sublime Text 3 settings
{
"color_scheme": "Packages/User/Tomorrow-Night (SL).tmTheme",
"detect_slow_plugins": false,
"dictionary": "Packages/Language - English/en_GB.dic",
"ensure_newline_at_eof_on_save": true,
"folder_exclude_patterns":
[
".svn",
".git",
".hg",