Skip to content

Instantly share code, notes, and snippets.

@maximspokoiny
maximspokoiny / gist:34ad60ad90944f8a80c6fc093873a807
Created May 8, 2016 19:30
Fix js_composer element render function
/**
* Convert html into correct element
* @param html
*/
html2element: function(html) {
var attributes = {},
$template;
if (_.isString(html)) {
this.template = _.template(html);
$template = $(this.template(this.model.toJSON(), vc.templateOptions.default).trim());
@TheLarkInn
TheLarkInn / bootStrapItNow.ts
Last active November 30, 2016 16:00
How to bundle up custom plugins with EVENT_MANAGER_PLGUINS
import {bootstrap} from 'angular2/platform/browser';
import {DIRECTIVES, PIPES, PROVIDERS, ENV_PROVIDERS, PLUGINS} from './platform/browser';
import {App, APP_PROVIDERS} from './app';
bootstrap(App, [
...PROVIDERS,
...ENV_PROVIDERS,
...DIRECTIVES,
...PIPES,
...APP_PROVIDERS,
@TheLarkInn
TheLarkInn / outside_event.plugin.ts
Created April 22, 2016 20:24
EventManagerPlugin extension to add to EVENT_MANAGER_PLUGINS for Angular2. Lets you handle clicking outside of target element.
import {DomEventsPlugin} from 'angular2/platform/common_dom';
// Have to pull DOM from src because platform/common_dom returns DOM as null.
// I believe its a TS bug.
import {DOM} from 'angular2/src/platform/dom/dom_adapter';
import {Injectable} from 'angular2/core';
import {noop} from 'angular2/src/facade/lang';
@Injectable()
export class DOMOutsideEventPlugin extends DomEventsPlugin {
eventMap: Object = {
@popcorn245
popcorn245 / hue_colors.md
Last active December 10, 2023 03:10
XY Color Conversion

FROM HUE DESIGN DOCS

https://github.com/PhilipsHue/PhilipsHueSDK-iOS-OSX/blob/00187a3db88dedd640f5ddfa8a474458dff4e1db/ApplicationDesignNotes/RGB%20to%20xy%20Color%20conversion.md

#Conversion between RGB and xy in the CIE 1931 colorspace for hue The conversion between RGB and xy in the CIE 1931 colorspace is not something Philips invented, but we have an optimized conversion for our different light types, like hue bulbs and LivingColors. It is important to differentiate between the various light types, because they do not all support the same color gamut. For example, the hue bulbs are very good at showing nice whites, while the LivingColors are generally a bit better at colors, like green and cyan.

@brandondurham
brandondurham / styles.less
Last active August 5, 2025 09:01
Using Operator Mono in Atom
/**
* Using Operator Mono in Atom
*
* 1. Open up Atom Preferences.
* 2. Click the “Open Config Folder” button.
* 3. In the new window’s tree view on the left you should see a file called “styles.less”. Open that up.
* 4. Copy and paste the CSS below into that file. As long as you have Operator Mono SSm installed you should be golden!
* 5. Tweak away.
*
* Theme from the screenshot (http://cdn.typography.com/assets/images/blog/operator_ide2.png):
@rogeruiz
rogeruiz / _wp-gravity-forms.css
Last active August 6, 2019 05:02
Gravity Forms SCSS Module
$color--form-background: #fcfcfc;
$color--form-text: #333;
$color--form-border: #e5e4e4;
$color--radio-checkbox: #555;
$color--blue: blue;
$color--pink: pink;
$color--red: red;
$color--validation: $color--red;
$color--required: $color--red;
$color--error: $color--red;
@spivurno
spivurno / gw-wc-gf-product-addons-process-feeds.php
Last active April 3, 2017 15:34
Gravity Wiz // WooCommerce Gravity Forms Product Add-ons // Process Feeds & Send Notifications
<?php
/**
* Gravity Wiz // WooCommerce Gravity Forms Product Add-ons // Process Feeds & Send Notifications
*
* Process Gravity Forms feeds on checkout for any GF-powered product in the cart. Currently supports GF Mailchimp add-on.
*
* @version 1.0
* @author David Smith <david@gravitywiz.com>
* @license GPL-2.0+
* @link http://gravitywiz.com/...
<?php
/*
Plugin Name: Gravity Forms MailChimp Custom Export
Plugin URI: http://gravityview.co/
Description: Custom plugin to force updated entries to be exported with the GF MailChimp add-on
Author: Katz Web Services, Inc.
Version: 1.1.0
Author URI: http://www.katzwebservices.com
Copyright 2014 Katz Web Services, Inc. (email: info@katzwebservices.com)
@spivurno
spivurno / gp-read-only-style-guide.css
Last active September 15, 2022 13:16
Gravity Perks // GP Read Only // Style Guide
/* most field types */
.gform_wrapper input[readonly='readonly'] {
/* custom styles */
}
/* selects */
.gform_wrapper select[disabled='disabled'] {
/* custom styles */
}
@thewebprincess
thewebprincess / dateform.js
Last active May 15, 2023 19:33
Gravity Forms - Datepicker extension for Date Range Fields
jQuery(function ($) {
var datepickerInArgs = {
minDate: 1,
defaultDate: 0,
dateFormat: 'dd/mm/yy',
changeMonth: true,
changeYear: true,
onClose: function( dateText, inst ) {
var d = $.datepicker.parseDate( inst.settings.dateFormat, dateText );