This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Your keymap | |
# | |
# Atom keymaps work similarly to style sheets. Just as style sheets use | |
# selectors to apply styles to elements, Atom keymaps use selectors to associate | |
# keystrokes with events in specific contexts. Unlike style sheets however, | |
# each selector can only be declared once. | |
# | |
# You can create a new keybinding in this file by typing "key" and then hitting | |
# tab. | |
# |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function color_meter(cwith, ccolor) { | |
if (!cwith && !ccolor) return; | |
var _cwith = (cwith.charAt(0)=="#") ? cwith.substring(1,7) : cwith; | |
var _ccolor = (ccolor.charAt(0)=="#") ? ccolor.substring(1,7) : ccolor; | |
var _r = parseInt(_cwith.substring(0,2), 16); | |
var _g = parseInt(_cwith.substring(2,4), 16); | |
var _b = parseInt(_cwith.substring(4,6), 16); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// required moment-timezone-with-data.js | |
String.prototype.toLocalTime = function() { | |
return moment(moment.tz(this, 'YYYY-MM-DD HH:mm:ss', wpTimezone)) | |
.tz(moment.tz.guess()) | |
.format('YYYY-MM-DD HH:mm:ss'); | |
}; | |
String.prototype.toWPTime = function() { | |
return moment(this, 'YYYY-MM-DD HH:mm:ss').tz(wpTimezone).format('YYYY-MM-DD HH:mm:ss'); | |
}; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* $people_id = contact or company id | |
* meta data saved in 'PREFIX_erp_peoplemeta' table | |
* for hook documentation see `update_metadata` function located in `wp-includes/meta.php` WordPress core file | |
*/ | |
add_filter( 'update_erp_people_metadata', function ( $check, $people_id, $meta_key, $meta_value, $prev_value ) { | |
if ( 'photo_id' === $meta_key ) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// source: https://github.com/andymantell/node-wpautop | |
function _autop_newline_preservation_helper (matches) { | |
return matches[0].replace( "\n", "<WPPreserveNewline />" ); | |
}, | |
function wpautop(pee, br) { | |
if(typeof(br) === 'undefined') { | |
br = true; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// use `erp_states` filter hook to add country states | |
add_filter( 'erp_states', function ( $states ) { | |
$states['NL'] = [ | |
'DR' => 'Drenthe', | |
'FL' => 'Flevoland', | |
'FR' => 'Fryslân (fy)', | |
'GE' => 'Gelderland', | |
'GR' => 'Groningen', |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Use the new media manager to handle uploads to Soliloquy. | |
$('#soliloquy-area').on('click.soliloquyUpload', '#soliloquy-upload', function(e){ | |
// Prevent the default action from occuring. | |
e.preventDefault(); | |
// Variable to hold our media applicaton. | |
var soliloquy_frame; | |
// If the media frame already exists, reopen it and return. | |
if ( soliloquy_frame ) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
set -euo pipefail | |
IFS=$'\n\t' | |
# Ubuntu 16.04 Dev Server | |
# Run like - bash install_lamp.sh | |
# Script should auto terminate on errors | |
echo -e "\e[96m Adding PPA \e[39m" | |
sudo add-apt-repository -y ppa:ondrej/apache2 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
data() { | |
return { | |
questions: [ | |
{ | |
... | |
}, | |
{ | |
... | |
} | |
... |