Skip to content

Instantly share code, notes, and snippets.

View funkjedi's full-sized avatar

Tim Robertson funkjedi

View GitHub Profile
@funkjedi
funkjedi / cleaner-pipefy.user.css
Created June 12, 2020 18:43
Userstyle for Pipefy
@import "//fonts.googleapis.com/css?family=Lato";
.pp-card .pp-card-content p { font-weight: normal; line-height: 1.2; }
.pp-phases-item.pp-phase-done,
.pp-card .pp-card-footer,
.pp-card .pp-card-footer .pp-card-users,
.pp-open-card .pp-empty-state-container { display:none; }
@funkjedi
funkjedi / bookmarklet.js
Last active September 18, 2023 02:03
Simple YouTube bookmarklet that hides everything and makes the video full size
(function() {
class YT_Max {
constructor() {
this.maximized = false;
this.resizeHander = (event => {
this.setStyles();
});
}
@funkjedi
funkjedi / remove_ufw_chains.sh
Created July 11, 2017 18:40
Remove UFW chains
#!/bin/bash
for ufw in `iptables -L | grep 'Chain ufw' | awk '{ print $2 }'`; do iptables -F $ufw; done
for ufw in `iptables -L | grep 'Chain ufw' | awk '{ print $2 }'`; do
iptables -D INPUT -j $ufw
iptables -D FORWARD -j $ufw
iptables -D OUTPUT -j $ufw
done
@funkjedi
funkjedi / tw-bootstrap.css
Created January 27, 2017 23:25
Twitter Bootstrap v3.3.7 (Namespaced)
.tw-bootstrap {
/*!
* Bootstrap v3.3.7 (http://getbootstrap.com)
* Copyright 2011-2016 Twitter, Inc.
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
*/
/*! normalize.css v3.0.3 | MIT License | github.com/necolas/normalize.css */
/*! Source: https://github.com/h5bp/html5-boilerplate/blob/master/src/css/main.css */
/*# sourceMappingURL=bootstrap.css.map */
}
@funkjedi
funkjedi / globstar.php
Created January 21, 2017 22:38
Extended glob() to support double star ** (globstar) wildcard.
<?php
function globstar($pattern, $flags = 0) {
if (stripos($pattern, '**') === false) {
$files = glob($pattern, $flags);
}
else {
$position = stripos($pattern, '**');
$rootPattern = substr($pattern, 0, $position - 1);
$restPattern = substr($pattern, $position + 2);
@funkjedi
funkjedi / 474.php
Last active January 17, 2017 18:26
Display Information About the Registered Actions and Filters in Wordpress
<?php
function wp_filter_dump($name) {
global $wp_filter;
$handlers = array();
if (!isset($wp_filter[$name])) {
return $handlers;
}
/**
* Based on goog.userAgent.flash
* @license Apache-2.0
* @see {@link https://code.google.com/p/closure-library/source/browse/closure/goog/useragent/flash.js}
*/
function getFlashVersion() {
var getVersion = function(desc) {
var matches = desc.match(/[\d]+/g);
if (!matches) {
return "";
@funkjedi
funkjedi / gist:5820170bc0c7642a4cb4
Last active August 29, 2015 14:18
Scroll to anchor
// Handle links with href started with '#' only.
jQuery(document).on('click', 'a[href]', function(e) {
// target element id
var id = jQuery(this).attr('href');
if (!id.match(/^#/) || jQuery(id).length === 0 || jQuery(this).hasClass('ui-tabs-anchor')) {
return;
}
// prevent standard hash navigation (avoid blinking in IE)
@funkjedi
funkjedi / functions.php
Created February 26, 2015 16:21
Extend qTranslate Slug for WordPress to automatically generate slugs qTranslate-X
<?php
add_action('admin_footer', 'qtranslate_slug_snippet');
function qtranslate_slug_snippet() {
?>
<script>
function string_to_slug(str) {
str = str.replace(/^\s+|\s+$/g, ''); // trim
str = str.toLowerCase();
@funkjedi
funkjedi / marionette.handlebars.js
Last active April 5, 2024 14:29
Integrates Handlebars with Marionette. First attempts to load pre-compiled templates, then by selector, and finally via XHR.
/**
Usage: Just include this script after Marionette and Handlebars loading
IF you use require.js add script to shim and describe it in the requirements
*/
(function(Handlebars, Marionette) {
Marionette.Handlebars = {
path: 'templates/',
extension: '.handlebars'
};