Skip to content

Instantly share code, notes, and snippets.

@lschatzkin
lschatzkin / css3 cross browser
Created July 16, 2013 17:43
css3 cross browser
.class-name {
-khtml-css3-property: 3px;
-moz-css3-property: 3px;
-webkit-css3-property: 3px;
css3-property: 3px;
}
@lschatzkin
lschatzkin / generate ssh key
Last active March 8, 2017 23:53
generate ssh key via command line
ps -e | grep [s]sh-agent // see if agent is running
ssh-agent // see if agent is running
ssh-add -l // list keys
ssh-keygen -t dsa -f ~/.ssh/id_dsa -C "[email protected]" // add key id_dsa ***MAKE A NOTE OF THE PASSCODE!***
ssh-add ~/.ssh/id_dsa // add keys to agent
ssh-add ~/.ssh/id_dsa.pub
ssh -T [email protected] -v // check to see if connection to Bitbucket is working
// If ssh-add returns "Could not open a connection to your authentication agent." error.
exec ssh-agent bash
@lschatzkin
lschatzkin / page.php
Created March 4, 2014 17:34
Bay Nature page.php
<?php get_header(); the_post(); ?>
<!-- content -->
<div id="content" class="left">
<?php display_breadcrumbs() ?>
<div class="post">
<?php display_title(); ?>
<div class="entry">
<?php the_content(); ?>
</div>
</div>
@lschatzkin
lschatzkin / gist:3405ede11c1c0f6b3c3f
Created May 20, 2014 17:48
WordPress: Hide content-box on specific pages in admin
function remove_editor() {
if (isset($_GET['post'])) {
$id = $_GET['post'];
$template = get_post_meta($id, '_wp_page_template', true);
if($template == 'template_name.php'){
remove_post_type_support( 'page', 'editor' );
}
}
}
@lschatzkin
lschatzkin / external links
Created June 6, 2014 19:19
add target=_blank to all external links on a site
var viewportWidth = $(window).width();
if (viewportWidth < 481){ }
<?php
//Nature News loop, featured article with thumbnail
$args = array (
'posts_per_page' => '1',
'page_id' => '4444'
);
$query = new WP_Query( $args );
echo '<h3 class="title">The Title</h3>';
// The Loop
git clean -f =>DELETES untracked WARNING!!!!!
git reflog -- summary with commit #, then:
GO BACK TO PREV COMMIT:
git reset ---hard <filename>
REMOVE COMMITTED:
git reset HEAD <file>
UN-ADD files => git reset FILE
RESTORE PREV VER OF 1 FILE=>
@lschatzkin
lschatzkin / WP_Query-count
Created September 28, 2015 18:51
count number of posts in WP_Query results $post_count = $freereads_query->found_posts;
$my_query = new WP_Query($freereads_args);
$post_count = $my_query->found_posts;
@lschatzkin
lschatzkin / youtube.css
Created October 1, 2015 21:41
youtube video container css
.video-container {
position: relative;
padding-bottom: 56.25%;
padding-top: 30px; height: 0; overflow: hidden;
}
.video-container iframe,
.video-container object,
.video-container embed {
position: absolute;