Skip to content

Instantly share code, notes, and snippets.

@anatol06
anatol06 / index.php
Created May 6, 2018 16:11
Link to the author posts by ID
<a href="<?php echo get_author_posts_url( get_the_author_meta('ID')); ?>"><?php the_author(); ?></a>
@anatol06
anatol06 / single.php
Last active May 4, 2018 19:31
WP - Insert Sidebar
<?php if(is_active_sidebar('sidebar')) : ?>
<?php dynamic_sidebar('sidebar'); ?>
<?php endif; ?>
@anatol06
anatol06 / index.php
Last active May 7, 2018 18:33
WP - Meta List
<ul class="meta">
<li>By
<a href="<?php echo get_author_posts_url(get_the_author_meta('ID')); ?>">
<?php the_author(); ?></a>
</li>
<li><?php the_time('F j, Y g:i a'); ?></li>
<li>
<?php
$categories = get_the_category();
$separator = ", ";
@anatol06
anatol06 / index.php
Last active May 4, 2018 19:30
WP - title tag for Wordpress
<?php bloginfo('name'); ?> | <?php is_front_page() ? bloginfo('description') : wp_title(''); ?>
@anatol06
anatol06 / functions.php
Last active May 4, 2018 19:30
WP - Get Submenu Items
// Get Top Parent Page (in functions.php)
function get_top_parent() {
global $post;
if($post->post_parent) {
$ancestors = array_reverse(get_post_ancestors($post->ID));
return $ancestors[0];
}
return $post->ID;
}
@anatol06
anatol06 / functions.php
Last active May 7, 2018 19:29
Register One Widget
// Widget Locations
function init_widgets($id) {
register_sidebar(array(
'name' => 'Sidebar',
'id' => 'sidebar',
'before_widget' => '<div class="sidebar-widget">',
'after_widget' => '</div>',
'before_title' => '<h3>',
'after_title' => '</h3>'
));
@anatol06
anatol06 / comments.php
Last active May 6, 2018 21:54
WP - Comments Args and Form
<?php
$args = array(
'walker' => null,
'max_depth' => '',
'style' => 'ul',
'callback' => null,
'end-callback' => null,
'type' => 'all',
'reply_text' => 'Reply',
'page' => '',
@anatol06
anatol06 / css_resources.md
Last active August 29, 2015 14:20 — 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

@anatol06
anatol06 / python_resources.md
Last active August 29, 2015 14:20 — forked from jookyboi/python_resources.md
Python-related modules and guides.

Packages

  • lxml - Pythonic binding for the C libraries libxml2 and libxslt.
  • boto - Python interface to Amazon Web Services
  • Django - Django is a high-level Python Web framework that encourages rapid development and clean, pragmatic design.
  • Fabric - Library and command-line tool for streamlining the use of SSH for application deployment or systems administration task.
  • PyMongo - Tools for working with MongoDB, and is the recommended way to work with MongoDB from Python.
  • Celery - Task queue to distribute work across threads or machines.
  • pytz - pytz brings the Olson tz database into Python. This library allows accurate and cross platform timezone calculations using Python 2.4 or higher.

Guides

@anatol06
anatol06 / rails_resources.md
Last active August 29, 2015 14:20 — forked from jookyboi/rails_resources.md
Rails-related Gems and guides to accelerate your web project.

Gems

  • Bundler - Bundler maintains a consistent environment for ruby applications. It tracks an application's code and the rubygems it needs to run, so that an application will always have the exact gems (and versions) that it needs to run.
  • rabl - General ruby templating with json, bson, xml, plist and msgpack support
  • Thin - Very fast and lightweight Ruby web server
  • Unicorn - Unicorn is an HTTP server for Rack applications designed to only serve fast clients on low-latency, high-bandwidth connections and take advantage of features in Unix/Unix-like kernels.
  • SimpleCov - SimpleCov is a code coverage analysis tool for Ruby 1.9.
  • Zeus - Zeus preloads your Rails app so that your normal development tasks such as console, server, generate, and specs/tests take less than one second.
  • [factory_girl](h