Skip to content

Instantly share code, notes, and snippets.

View davidwerks's full-sized avatar

davidwerks

  • Sun
View GitHub Profile
//apply only to forms with the action pointing to Basin
$('form[action^="https://usebasin.com"]').each(function(i,el){
console.log($(el));
$(el).submit(function(e){
//stop the form from submitting
e.preventDefault();
const _form = $(e.target);
// form parent
const _parent = $(_form.parent());
//get the form's action parameter and add ".json" to the end
@davidwerks
davidwerks / scroll-link
Created August 18, 2017 20:55
scroll-link markup
<ul class="timeline vertical-indication">
<li>
<div class="row">
<div class="timeline-title column width-3 right left-on-mobile">
<h5>Timeline Title</h5>
</div>
<div class="timeline-description column width-9">
<p>Timeline Description</p>
</div>
</div>
/**
* http://cuckooparrot.com/
*/
/** extra fonts */
@import url('https://fonts.googleapis.com/css?family=Pacifico|Sofia|Slabo+27px');
/** css */
.header .logo a {
@davidwerks
davidwerks / jscomposer UI.js
Last active December 13, 2017 16:38
Expanded version of jscomposer UI.js
function vc_toTitleCase(str) {
return str.replace(/\w\S*/g, function(txt) {
return txt.charAt(0).toUpperCase() + txt.substr(1).toLowerCase()
})
}
function vc_convert_column_size(width) {
var numbers = width ? width.split("/") : [1, 1],
range = _.range(1, 13),
num = !_.isUndefined(numbers[0]) && 0 <= _.indexOf(range, parseInt(numbers[0], 10)) && parseInt(numbers[0], 10),
<?php
namespace ThemeMountain;
/** Find basename */
if(isset($this)) {
$_base = $this->settings['base'];
} else if (isset($tagname)) {
$_base = $tagname;
} else {
$_base = FALSE;
<script src="http://maps.googleapis.com/maps/api/js?v=3"></script>
@davidwerks
davidwerks / gist:36166c27748ce46471854224b1ec7138
Created September 16, 2016 21:11
Example Google Maps (CSS timber framework)
<!-- Map Section -->
<div class="section-block no-padding">
<div class="row collapse full-width">
<div class="column width-12 center">
<div class="map-container" data-coordinates="[[40.723301,-74.002988]]" data-icon='"images/assets/map-marker.png"' data-info='"Downtown New York Office<br>44 St. West 32"' data-zoom-level="13" data-style="color">
<div class="map-canvas" id="map-canvas-1"></div>
</div>
</div>
</div>
</div>