Skip to content

Instantly share code, notes, and snippets.

View jholl's full-sized avatar

James Holland jholl

View GitHub Profile
@tokenvolt
tokenvolt / simple_form_bootstrap3.rb
Last active November 2, 2023 11:55
Bootstrap 3 simple form initializer
inputs = %w[
CollectionSelectInput
DateTimeInput
FileInput
GroupedCollectionSelectInput
NumericInput
PasswordInput
RangeInput
StringInput
TextInput
@svenl77
svenl77 / bootstrap-wordpress-default-widgets
Created August 7, 2013 12:38
Add Bootstrap classes to WordPress core html elements - default widgets and comments. If you want to build a WordPress theme using twitter bootstrap, this will help you to add all needed classes to html witch comes from functions inside WordPress like widgets and comments.
// first set the body to hide and show everyhthing when fully loaded ;)
document.write("<style>body{display:none;}</style>");
jQuery(document).ready(function(){
jQuery( 'input.search-field' ).addClass( 'form-control' );
// here for each comment reply link of wordpress
jQuery( '.comment-reply-link' ).addClass( 'btn btn-primary' );
@carolineschnapp
carolineschnapp / gist:5397337
Last active January 20, 2023 10:11
Sample JavaScript file added with ScriptTag resource. This sample file is meant to teach best practices. Your app will load jQuery if it's not defined. Your app will load jQuery if jQuery is defined but is too old, e.g. < 1.7.
/* Sample JavaScript file added with ScriptTag resource.
This sample file is meant to teach best practices.
Your app will load jQuery if it's not defined.
Your app will load jQuery if jQuery is defined but is too old, e.g. < 1.7.
Your app does not change the definition of $ or jQuery outside the app.
Example: if a Shopify theme uses jQuery 1.4.2, both of these statements run in the console will still return '1.4.2'
once the app is installed, even if the app uses jQuery 1.9.1:
jQuery.fn.jquery => "1.4.2"
$.fn.jquery -> "1.4.2"
*/