Skip to content

Instantly share code, notes, and snippets.

@plsankar
plsankar / mailchimp4wordpress.scss
Created October 5, 2020 14:46 — forked from scharc/mailchimp4wordpress.scss
Resonds format for MailChimp4WordPress Plugin in combination with bootstrap 3.3.6
#newsletter-form {
color: white;
input {
border-radius: 0px !important;
}
.mc4wp-response {
text-align: center;
@extend .container;
margin: 15px 0px;
.mc4wp-alert,
public abstract class LoadMoreListener extends RecyclerView.OnScrollListener {
private static final int ITEMS_PER_PAGE = 10;
private boolean loading = false;
private int page = 1;
@Override
public void onScrolled(@NonNull RecyclerView recyclerView, int dx, int dy) {
super.onScrolled(recyclerView, dx, dy);
@plsankar
plsankar / header_http_status_codes.php
Created June 6, 2020 17:17 — forked from phoenixg/header_http_status_codes.php
PHP header() for sending HTTP status codes
<?php
/*
参考自:
http://darklaunch.com/2010/09/01/http-status-codes-in-php-http-header-response-code-function
http://snipplr.com/view/68099/
*/
function HTTPStatus($num) {
$http = array(
//* Adding DNS Prefetching
function wp_dns_prefetch() {
echo '<meta http-equiv="x-dns-prefetch-control" content="on">
<link rel="dns-prefetch" href="//fonts.googleapis.com" />
<link rel="dns-prefetch" href="//fonts.gstatic.com" />
<link rel="dns-prefetch" href="//ajax.googleapis.com" />
<link rel="dns-prefetch" href="//apis.google.com" />
<link rel="dns-prefetch" href="//google-analytics.com" />
<link rel="dns-prefetch" href="//www.google-analytics.com" />
<link rel="dns-prefetch" href="//ssl.google-analytics.com" />
@plsankar
plsankar / custom-domain-localhost-xampp
Created July 16, 2019 13:16 — forked from oozman/custom-domain-localhost-xampp
How to add a custom domain name on your localhost using XAMPP. Codes are based on Windows, but Step 2 onwards are pretty much applicable on other operating system.
Step 1:
Go to: C:\Windows\System32\Drivers\etc\hosts
And add this to the bottom of the file:
=============
127.0.0.1 your.domain.com
=============
Step 2:
Go to [your XAMPP directory]/apache/conf/httpd-xampp.conf
<!DOCTYPE html>
<html>
<head>
<script src="https://code.jquery.com/jquery-3.1.0.js"></script>
<meta charset="utf-8">
<meta property="og:image" content="https://fotos.subefotos.com/408e393e09f5467a27bfc29faacbc7a3o.jpg" />
<meta name="viewport" content="width=device-width">
<title>JS Bin</title>
</head>
<body>
@plsankar
plsankar / EqualSpacingItemDecoration.java
Created February 1, 2018 16:41 — forked from alexfu/EqualSpacingItemDecoration.java
Add equal spacing to RecyclerView items automatically. Can handle horizontal, vertical, and grid display modes
import android.graphics.Rect;
import android.support.v7.widget.GridLayoutManager;
import android.support.v7.widget.RecyclerView;
import android.view.View;
public class EqualSpacingItemDecoration extends RecyclerView.ItemDecoration {
private final int spacing;
private int displayMode;
public static final int HORIZONTAL = 0;