Skip to content

Instantly share code, notes, and snippets.

View waitingallday's full-sized avatar
😵
Reading the manual

Jason Smith waitingallday

😵
Reading the manual
View GitHub Profile
@waitingallday
waitingallday / Brewfile
Created September 15, 2022 03:02
Brewfile
# specify a directory to install
cask_args appdir: '/Applications'
# install packages
tap "homebrew/bundle"
tap "homebrew/cask"
tap "github/gh"
tap "amazeeio/lagoon-cli"
tap "romkatv/powerlevel10k"
@waitingallday
waitingallday / Brewfile
Last active November 8, 2021 22:29 — forked from dylankelly/Brewfile
# specify a directory to install
cask_args appdir: '/Applications'
# install packages
tap "homebrew/cask"
tap "github/gh"
tap "amazeeio/lagoon-cli"
tap "romkatv/powerlevel10k"
# Essential SDP tools
@waitingallday
waitingallday / commands.sh
Created April 11, 2019 03:55
commands cheat sheet
find . -name '.htaccess' | grep -v twig
pagetitle() {
return this.$t('course.overview').toLowerCase().slice(0,1).toUpperCase() + this.$t('course.overview').toLowerCase().slice(1);
},
@waitingallday
waitingallday / pagination.js
Created May 29, 2018 05:54
Figure out the pagination buttons
Handlebars.registerHelper('pagebuttons', function(totalMatching, currStart, query) {
var q = query,
out = "",
pages = (parseInt(totalMatching / 10)) + 1,
currPage = currStart <= 1 ? 1 : (currStart + 9) / 10,
startPage = (currPage - 2) >= 1 ? (currPage === pages ? currPage - 2 : currPage - 1) : 1,
endPage = (currPage + 2) <= pages ? (currPage === 1 ? currPage + 2 : currPage + 1) : pages,
i;
for (i = startPage; i <= endPage; i++) {
@waitingallday
waitingallday / gist:e3b3e86c60c861a78d3a35d1e2e5a4e1
Created January 4, 2018 06:16
regex for youtube URL, extracts videoid into named group
(?:[youtbe.com\/wahd\?])(?:\w+=[\w+,.-]+\&)*(?:v=)?(?<videoid>[a-zA-Z0-9\-\_]{6,60})(?:\&\w+=[\w+,.-]+)*$
@waitingallday
waitingallday / image-in-feed.rb
Created October 22, 2015 04:43
This is what I used for featuring an image in the feed display ("today" tab), it matches the first image in the feed content body
recordset.each do |entry|
# Some other stuff
# ...
image_field = 'content' # 'description' in rss
unless entry[image_field].nil?
img = entry[image_field].match(/<img.+?src=[\"'](.+?)[\"'].*?>/)
unless img.nil?
item[:image] = raw.merge(img[1]).to_s
@waitingallday
waitingallday / antihashbang.js
Created June 18, 2014 06:22
Defeat the hash #
form = document.querySelector("form");
form.addEventListener("submit", function(event) {
e.preventDefault();
window.location = this.action + "#q=" + this.elements[1].value
}
// or you could wrap it in a domready container ie.
var domReady = function() {
n = document.querySelector("form"), n.addEventListener("submit", function(e) {

Keybase proof

I hereby claim:

  • I am waitingallday on github.
  • I am waitingallday (https://keybase.io/waitingallday) on keybase.
  • I have a public key whose fingerprint is 64DE 4D03 53E8 8064 16B5 7E7A 7E6E BD36 D32A E9D5

To claim this, I am signing this object:

@waitingallday
waitingallday / Gruntfile.coffee
Last active August 29, 2015 13:55
Rebuild any number of independent sub-repos and consolidate in a single distribution point. Slightly opinionated (sub-repos need to copy built files to dist/ in their default task).
module.exports = (grunt) ->
'use strict'
mods = []
for m in grunt.file.expand(['*/', '!node_modules/', '!dist/'])
mods.push m.slice(0,-1)
hubs = []
copies = []
watches['all'] =