Skip to content

Instantly share code, notes, and snippets.

View saivarunk's full-sized avatar
💭
drowned into k8s

Varun Kruthiventi saivarunk

💭
drowned into k8s
View GitHub Profile
@saivarunk
saivarunk / h20automl.r
Created October 1, 2017 21:31
H2O Auto ML Starter
library(data.table)
library(h2o)
# Load train and properties data
properties <- fread("../input/properties_2016.csv", header=TRUE, stringsAsFactors=FALSE, colClasses = list(character = 50))
train <- fread("../input/train_2016_v2.csv")
training <- merge(properties, train, by="parcelid",all.y=TRUE)
# Initialise h20
@saivarunk
saivarunk / angularjs-providers-explained.md
Created September 2, 2016 06:52 — forked from demisx/angularjs-providers-explained.md
AngularJS Providers: Constant/Value/Service/Factory/Decorator/Provider
Provider Singleton Instantiable Configurable
Constant Yes No No
Value Yes No No
Service Yes No No
Factory Yes Yes No
Decorator Yes No? No
Provider Yes Yes Yes

Constant

<html>
<head>
<title>Angular 2 First App</title>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="styles.css">
<!-- 1. Load libraries -->
<!-- Polyfill(s) for older browsers -->
<script src="node_modules/core-js/client/shim.min.js"></script>
<script src="node_modules/zone.js/dist/zone.js"></script>
//* Modify the speak your mind title in comments
add_filter( 'comment_form_defaults', 'sv_comment_form_defaults' );
function sv_comment_form_defaults( $defaults ) {
$defaults['title_reply'] = __( 'Comments' );
return $defaults;
}
//* Modify the size of the Gravatar in comments
add_filter( 'genesis_comment_list_args', 'sv_comments_gravatar' );
function sv_comments_gravatar( $args ) {
$args['avatar_size'] = 96;
return $args;
}
//* Customize the submit button text in comments
add_filter( 'comment_form_defaults', 'sv_comment_submit_button' );
function sv_comment_submit_button( $defaults ) {
$defaults['label_submit'] = __( 'Submit', 'custom' );
return $defaults;
}
//* Add a comment policy box in comments
add_action( 'genesis_after_comments', 'sv_comment_policy' );
function sv_comment_policy() {
if ( is_single() && !is_user_logged_in() && comments_open() ) {
?>
<div class="comment-policy-box">
<p class="comment-policy"><small><strong>Comment Policy:</strong>All the comments and approved upon verification</small></p>
</div>
<?php
//* Remove comment form allowed tags
add_filter( 'comment_form_defaults', 'sv_remove_comment_form_allowed_tags' );
function sv_remove_comment_form_allowed_tags( $defaults ) {
$defaults['comment_notes_after'] = '';
return $defaults;
}
//* Modify the comment link text in comments
add_filter( 'genesis_post_info', 'sv_post_info_filter' );
function sv_post_info_filter( $post_info ) {
return '[post_comments zero="Leave a Comment" one="1 Comment" more="% Comments"]';
}
//* Modify the size of the Gravatar in the author box
add_filter( 'genesis_author_box_gravatar_size', 'author_box_gravatar_size' );
function author_box_gravatar_size( $size ) {
return '80';
}