Skip to content

Instantly share code, notes, and snippets.

View willthemoor's full-sized avatar

Will Moore willthemoor

  • OHSU
  • Portland, OR
View GitHub Profile
@thamas
thamas / twig-random-pl.md
Last active April 16, 2019 21:41
Usage of Twig random() in Pattern Lab to provide more dynamic test content

willthemoor [1:17 AM] .
Just coming to realize the power of flat arrays within _data/data.json and the use of twig's random() function for mocking stuff in Pattern Lab. It's good living!

data.json

"schools" : [
  "Georgetown",
  "Harvard",
  "Princeton",
  "Yale"
@paceaux
paceaux / this.js
Last active March 11, 2020 20:37
const these = _itshelf = itshelf = _shelf = shelf = _itself = itself =_self = self = _me = me = _that = that = _this = this;
@kyleparisi
kyleparisi / osx_install.sh
Last active July 7, 2021 05:27 — forked from t-io/osx_install.sh
Install most of my Apps with homebrew & cask
#!/bin/sh
echo Install all AppStore Apps at first!
# no solution to automate AppStore installs
# Update: there is a way now, just haven't updated yet
ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
brew install mas
read -p "Press any key to continue... " -n1 -s
echo
mas install 1176895641 # Spark
@jchristopher
jchristopher / gist:9331899
Last active September 9, 2017 01:48
Integrate SearchWP and Jetpack Infinite Scroll
<?php
// Jetpack infinite scroll does it's own WP_Query, so we need to hijack it at runtime
function searchwp_infinite_scroll_query_args( $query_args ) {
if( class_exists( 'SearchWPSearch' ) ) {
$query = get_search_query();
if( empty( $query ) ) {
if( isset( $_GET['query_args']['s'] ) ) {
$query = sanitize_text_field( $_GET['query_args']['s'] );
}
@mannieschumpert
mannieschumpert / gist:8334811
Last active August 20, 2023 14:58
Filter the submit button in Gravity Forms to change the <input type="submit> element to a <button> element. There's an example in the Gravity Forms documentation, but it lacks the proper code to show your custom button text, AND removes important attributes like the onclick that prevents multiple clicks. I was trying to solve that.
<?php
// filter the Gravity Forms button type
add_filter("gform_submit_button", "form_submit_button", 10, 2);
function form_submit_button($button, $form){
// The following line is from the Gravity Forms documentation - it doesn't include your custom button text
// return "<button class='button' id='gform_submit_button_{$form["id"]}'>'Submit'</button>";
// This includes your custom button text:
return "<button class='button' id='gform_submit_button_{$form["id"]}'>{$form['button']['text']}</button>";
}
// Oops this strips important stuff
@hissy
hissy / rscsvimporter-debug.php
Last active April 6, 2020 03:24
Really Simple CSV Importer Debugger add-on
<?php
/*
Plugin Name: Really Simple CSV Importer Debugger add-on
Description: Enables to dry-run-testing with Really Simple CSV Importer. When this add-on plugin activated, csv data will not imported, just displayed on dashboard.
Author: Takuro Hishikawa
Version: 0.2
*/
class rscsvimporter_debug {
// singleton instance
@juanghurtado
juanghurtado / snipmatize.py
Created July 4, 2011 11:46 — forked from claytron/snipmatize.py
Convert TexMate snippets into snipMate compatible snippets
#!/usr/bin/env python2.6
"""
About
=====
Convert Texmate snippets into snipmate compatible snippets
http://www.vim.org/scripts/script.php?script_id=2540
http://macromates.com/