Skip to content

Instantly share code, notes, and snippets.

View matthisamoto's full-sized avatar

Matt Hisamoto matthisamoto

  • Savas Labs
  • Milwaukee, WI
View GitHub Profile
@garak
garak / list.html.twig
Last active September 9, 2024 21:51 — forked from tentacode/list.html.twig
Twig recursive macro
{% macro recursiveCategory(category) %}
{% import _self as self %}
<li>
<h4><a href="{{ path(category.route, category.routeParams) }}">{{ category }}</a></h4>
{% if category.children|length %}
<ul>
{% for child in category.children %}
{{ self.recursiveCategory(child) }}
{% endfor %}
@Bobz-zg
Bobz-zg / redirect-wp-post.php
Last active April 12, 2023 09:37
Redirects wordpress posts to new url: site.com/blog/post-name
<?php
/**
* Add new rewrite rule
*/
function create_new_url_querystring() {
add_rewrite_rule(
'blog/([^/]*)$',
'index.php?name=$matches[1]',
'top'
);
@marketinview
marketinview / hideSeparatorBeforeQuestion.js
Last active October 23, 2022 16:37
Qualtrics: Hide Separator Before Question. #qualtrics #js #jq #hide #separator
Qualtrics.SurveyEngine.addOnReady(function() {
jQuery("#"+this.questionId).prev('.Separator').hide();
});
@purzlbaum
purzlbaum / customizer.php
Last active March 17, 2024 20:37
Google Font select for WordPress Customizer
<?php
new theme_customizer();
class theme_customizer {
public function __construct() {
add_action( 'customize_register', array(&$this, 'customize_linje' ));
}
/**
* Customizer manager demo
@suryart
suryart / application.html.erb
Last active October 26, 2023 00:16
Rails 4 flash messages using Twitter Bootstrap(bootstrap-sass: https://github.com/thomas-mcdonald/bootstrap-sass). An improved version of https://gist.github.com/roberto/3344628
// layout file
<body>
<div class="container">
<%= flash_messages %>
<%= yield %>
</div><!-- /container -->
</body>