Skip to content

Instantly share code, notes, and snippets.

var str = "Foo isn't equal\nto bar.";
wrapChars(str); // => "<span>F</span><span>o</span><span>o</span> <span>i</span><span>s</span><span>n</span>'<span>t</span> <span>e</span><span>q</span><span>u</span><span>a</span><span>l</span> <span>t</span><span>o</span> <span>b</span><span>a</span><span>r</span>."
wrapWords(str); // => "<span>Foo</span> <span>isn</span>'<span>t</span> <span>equal</span> <span>to</span> <span>bar</span>."
wrapLines(str); // => "<span>Foo isn't equal</span> <span>to bar.</span>"
  • MAMP: https://www.mamp.info/en/downloads/
  • Craft CMS: https://craftcms.com/pricing
  • Open up MAMP
    • Preferences -> Web Server
      • Change Document Root to public folder in Craft CMS download
    • Start Servers
  • If it doesn't open automatically hit "open WebStart page"
  • tools -> phpMyAdmin
    • top left "new" button
  • database name: project_name
@rdallaire
rdallaire / index.html
Last active January 2, 2020 21:29
testing gistpad
<h1>Testing </h1>
@rdallaire
rdallaire / shortcodes.php
Created July 19, 2019 22:28
WordPress shortcodes for sage
<?php
namespace App;
use App\Controllers\App;
/**
* Return if Shortcodes already exists.
*/
if (class_exists('Shortcodes')) {
@rdallaire
rdallaire / cloudSettings
Last active July 17, 2019 18:27
code config
{"lastUpload":"2019-07-17T18:27:48.966Z","extensionVersion":"v3.4.0"}
@rdallaire
rdallaire / email-validation.js
Created June 25, 2019 22:22
jquery email validation
$('#cases-email').keyup(function(){
var email = $('#cases-email').val();
var filter = /^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/;
if (!filter.test(email)) {
//alert('Please provide a valid email address');
$("#cases-error-email").text('Please enter a valid email.');
$('#support-contact-cases .button').attr('disabled', true);
email.focus();
//return false;
} else {
# -*- mode: ruby -*-
# vi: set ft=ruby :
require 'yaml'
ip = '192.168.50.5' # pick any local IP
cpus = 1
memory = 1024 # in MB
ANSIBLE_PATH = __dir__ # absolute path to Ansible directory
@rdallaire
rdallaire / GTWForm.inc
Created April 12, 2016 20:55 — forked from emasters/GTWForm.inc
This is a basic form for registering for a GoToWebinar webinar. The code can be pasted into a page and it will work. It needs to have the webinar key inserted where indicated. You can get the key from the GTW URL, it is the number that makes up the final element of the registration URL. Some fun styling has been added so the forms look neat on w…
<form action="https://www2.gotomeeting.com/en_US/island/webinar/registration.flow" method="post" name="webinarRegistrationForm">
<div id="regParent" class="regFields">
<input type="hidden" name="Template" value="island/webinar/registration.tmpl">
<input type="hidden" name="Form" value="webinarRegistrationForm">
<input type="hidden" name="WebinarKey" value="##INSERT WEBINAR KEY HERE##">
<input type="hidden" name="ViewArchivedWebinar" value="false">
<input type="hidden" name="registrant" value="">
<input type="hidden" name="RegistrantTimeZoneKey" id="RegistrantTimeZoneKey" value="64">
<div class="formRow">
<span class="error">*</span><label for="Name_First">First Name: </label> <input type="text" name="Name_First" id="Name_First" value="" maxlength="128" class="fis">
@rdallaire
rdallaire / functions.php
Created March 3, 2016 19:34
custom post type for polylang
add_filter('pll_get_post_types', 'my_pll_get_post_types');
function my_pll_get_post_types($types) {
return array_merge($types, array('my-cpt' => 'my-cpt'));
}
@rdallaire
rdallaire / wp-config.php
Created January 25, 2016 19:09
Allow WordPress to update and install plugins with FTP
define('FS_METHOD', 'direct');