View _index_item.haml
.row.no-gutters.attachment_item.my-3{ class: "resource_#{resource.id}", data: { controller: "edit-in-place", "edit-in-place-update-url": resource_path(resource.id), "edit-in-place-resource": "resource" } } | |
.col | |
%input{ type: :hidden, name: "attachment_detail[attachment_id]", value: file.id } | |
%h6 | |
%span{ data: { target: "edit-in-place.input", fieldtype: "text", attr: "name", value: resource.name } } | |
%p | |
%span{ data: { target: "edit-in-place.input", fieldtype: "textarea", attr: "description", value: resource.description } } | |
.col-auto.pull-right | |
.btn-group{ role: "group" } | |
%button.btn.btn-sm{ type: "button", data: { action: "edit-in-place#editMode", target: "edit-in-place.editBtn" } } |
View cert-manager-http01-output.yaml
--- | |
# INGRESS | |
apiVersion: extensions/v1beta1 | |
kind: Ingress | |
metadata: | |
annotations: | |
kubernetes.io/ingress.class: nginx | |
nginx.ingress.kubernetes.io/whitelist-source-range: 0.0.0.0/0,::/0 | |
creationTimestamp: 2019-12-30T23:04:50Z | |
generateName: cm-acme-http-solver- |
View badge_helper.rb
def text_colour(bg_colour) | |
rgb = [bg_colour[0..1], bg_colour[2..3], bg_colour[4..5]].map! do |c| | |
c = c.to_i(16).to_f / 255.0 | |
c <= 0.03928 ? c / 12.92 : ((c + 0.055) / 1.055)**2.4 | |
end | |
(0.2126 * rgb[0] + 0.7152 * rgb[1] + 0.0722 * rgb[2]) <= 0.5 ? "fff" : "000" | |
end |
View gke_deploy.sh
# gke_deploy.sh | |
# Make sure we're in the right project and authenticated | |
gcloud config set project your-project | |
# Needed this on first run https://github.com/kubernetes/kubernetes/issues/30617 | |
# gcloud config set container/use_client_certificate True | |
# Regional cheaper than zonal and acceptable for staging | |
gcloud container clusters get-credentials staging \ | |
--zone northamerica-northeast1-a --project your-project |
View modals.coffee
# Modified from https://github.com/ifad/data-confirm-modal/blob/master/vendor/assets/javascripts/data-confirm-modal.js | |
$ -> | |
###* | |
# Builds the markup for a [Bootstrap modal](https://getbootstrap.com/docs/4.0/components/modal/) | |
# for the given `element`. Uses the following `data-` parameters to | |
# customize it: | |
# | |
# * `data-confirm`: Contains the modal body text. HTML is allowed. | |
# Separate multiple paragraphs using \n\n. | |
# * `data-commit`: The 'confirm' button text. "Confirm" by default. |
View temp_dump.py
import os, glob, sched, time, sys | |
from w1thermsensor import W1ThermSensor | |
from pymongo import MongoClient | |
from datetime import datetime | |
# Run mongo if it's not already running | |
#mongod | |
# Sensor array | |
sensors_available = W1ThermSensor.get_available_sensors([W1ThermSensor.THERM_SENSOR_DS18B20]) |
View input.min.js
var acf={ajaxurl:"",admin_url:"",wp_version:"",post_id:0,nonce:"",l10n:null,o:null,helpers:{get_atts:null,version_compare:null,uniqid:null,sortable:null,add_message:null,is_clone_field:null,url_to_object:null},validation:null,conditional_logic:null,media:null,fields:{date_picker:null,color_picker:null,Image:null,file:null,wysiwyg:null,gallery:null,relationship:null}};!function($){acf.helpers.isset=function(){var e=arguments,t=e.length,a=null,n;if(0===t)throw new Error("Empty isset");for(a=e[0],i=1;i<t;i++){if(e[i]===n||a[e[i]]===n)return!1;a=a[e[i]]}return!0},acf.helpers.get_atts=function(e){var t={};return $.each(e[0].attributes,function(e,i){"data-"==i.name.substr(0,5)&&(t[i.name.replace("data-","")]=i.value)}),t},acf.helpers.version_compare=function(e,t){if(typeof e+typeof t!="stringstring")return!1;for(var i=e.split("."),a=t.split("."),n=0,s=Math.max(i.length,a.length);s>n;n++){if(i[n]&&!a[n]&&parseInt(i[n])>0||parseInt(i[n])>parseInt(a[n]))return 1;if(a[n]&&!i[n]&&parseInt(a[n])>0||parseInt(i[n])<parseIn |
View wp_geo_products.php
class WP_Query_Geo extends WP_Query { | |
private $lat = NULL; | |
private $lng = NULL; | |
private $distance = NULL; | |
/** | |
* Constructor - adds necessary filters to extend Query hooks | |
*/ | |
public function __construct( $args = array() ) { | |
// Extract Latitude |
View hashbuddy.php
<?php | |
if ( !defined( 'ABSPATH' ) ) exit; | |
function hashbuddy_activity_hashtags_filter( $content ) { | |
global $bp; | |
$pattern = '/[#]([\p{L}_0-9a-zA-Z-]+)/iu'; | |
// Old line |
View style.css
/* | |
Theme Name: Canvas Child | |
Description: Canvas Child Theme Description | |
Author: Joshua Mark | |
Template: canvas | |
Version: 1.0.0 | |
License: GNU General Public License v2 or later | |
License URI: http://www.gnu.org/licenses/gpl-2.0.html | |
Tags: canvas, wddm, cats | |
Text Domain: canvas-child |
NewerOlder