Skip to content

Instantly share code, notes, and snippets.

@ABooooo
ABooooo / javascript_resources.md
Created August 5, 2014 11:25 — forked from jookyboi/javascript_resources.md
Here are a set of libraries, plugins and guides which may be useful to your Javascript coding.

Libraries

  • jQuery - The de-facto library for the modern age. It makes things like HTML document traversal and manipulation, event handling, animation, and Ajax much simpler with an easy-to-use API that works across a multitude of browsers.
  • Backbone - Backbone.js gives structure to web applications by providing models with key-value binding and custom events, collections with a rich API of enumerable functions, views with declarative event handling, and connects it all to your existing API over a RESTful JSON interface.
  • AngularJS - Conventions based MVC framework for HTML5 apps.
  • Underscore - Underscore is a utility-belt library for JavaScript that provides a lot of the functional programming support that you would expect in Prototype.js (or Ruby), but without extending any of the built-in JavaScript objects.
  • lawnchair - Key/value store adapter for indexdb, localStorage
@ABooooo
ABooooo / css_resources.md
Created August 5, 2014 11:25 — forked from jookyboi/css_resources.md
CSS libraries and guides to bring some order to the chaos.

Libraries

  • 960 Grid System - An effort to streamline web development workflow by providing commonly used dimensions, based on a width of 960 pixels. There are two variants: 12 and 16 columns, which can be used separately or in tandem.
  • Compass - Open source CSS Authoring Framework.
  • Bootstrap - Sleek, intuitive, and powerful mobile first front-end framework for faster and easier web development.
  • Font Awesome - The iconic font designed for Bootstrap.
  • Zurb Foundation - Framework for writing responsive web sites.
  • SASS - CSS extension language which allows variables, mixins and rules nesting.
  • Skeleton - Boilerplate for responsive, mobile-friendly development.

Guides

@ABooooo
ABooooo / new_gist_file_0
Created August 19, 2014 07:23
Read URL and create array after slash
<?php
$str = "http://$_SERVER[HTTP_HOST]$_SERVER[REQUEST_URI]";
$res = array_filter(explode("/", $str));
//echo $res[0];
if ($res[0] == "condition") {
// do something
@ABooooo
ABooooo / new_gist_file_0
Created August 19, 2014 07:25
Add custom field to post
echo get_post_meta($post->ID, 'customFieldName', true);
@ABooooo
ABooooo / new_gist_file_0
Created August 19, 2014 07:27
Add title permalink with attribute
echo '<a class="permaLink" href="';
echo the_permalink();
echo'" title="';
echo the_title_attribute();
echo'">';
echo the_title();
echo '</a>';
@ABooooo
ABooooo / new_gist_file_0
Created August 19, 2014 07:28
Include SVG to HTML
<object type="image/svg+xml" data="image.svg">Your browser does not support SVG</object>
@ABooooo
ABooooo / new_gist_file_0
Created August 19, 2014 07:30
Post loop
if ( have_posts() ) {
while ( have_posts() ) {
the_post();
// add title, content, custom field, ...
echo '<div class="posts">';
echo the_title();
echo get_the_content();
//the_content('Preberi več...');
@ABooooo
ABooooo / new_gist_file_0
Created August 19, 2014 07:32
Register menus
function register_my_menus() {
register_nav_menus(
array(
'header-menu' => __( 'MainMenu' ),
'footer-menu' => __( 'FooterMenu' ),
'left-menu' => __( 'LeftSideMenu' )
)
);
}
add_action( 'init', 'register_my_menus' );
@ABooooo
ABooooo / new_gist_file_0
Created August 19, 2014 07:35
Dropdown bootstrap menu
https://github.com/twittem/wp-bootstrap-navwalker
http://astronautweb.co/2012/10/wordpress-dropdown-bootstrap/
http://code.tutsplus.com/tutorials/how-to-integrate-bootstrap-navbar-into-wordpress-theme--wp-33410
// insert in menu code instead of wordpress menu code
<?php
wp_nav_menu( array(
@ABooooo
ABooooo / new_gist_file_0.php
Last active November 1, 2018 08:21
Hide admin bar on page preview
add_filter('show_admin_bar', '__return_false');