Skip to content

Instantly share code, notes, and snippets.

View GogulaSivannarayana's full-sized avatar
🏠
Work from home

Gogula Sivannarayana GogulaSivannarayana

🏠
Work from home
View GitHub Profile
@GogulaSivannarayana
GogulaSivannarayana / highlight-share-posts-only.php
Created December 4, 2023 06:48 — forked from ronalfy/highlight-share-posts-only.php
Highlight and Share - Enable Posts Only
<?php
// Can use Code Snippets to insert: https://wordpress.org/plugins/code-snippets/
// Only enable on single posts (blog posts).
add_filter(
'has_enable_content',
function( $load_content ) {
if ( is_single() ) {
return true;
}
return false;
@GogulaSivannarayana
GogulaSivannarayana / page-navigation.php
Created December 4, 2023 06:44 — forked from jwenerd/page-navigation.php
Page navigation shortcode for WordPress
<?php
/**
* @package Page Navigation Shortcode
* @version 0.1
*/
/*
Plugin Name: Page Navigation Shortcode
Description: This plugin automatically adds links to the previous and next pages at the bottom of page content. User's may disable for select pages as well on the page edit screen.
Author: TLT Studio
Version: 0.1
<?php
/* The new responsive image feature in wordpress 4.4 causes image sourceset attribuet
to insert images as HTTP rather than HTTPS. This completely breaks images on sites where
the site is loaded ( and in sometimes force-loaded) to be served via HTTPS
The following plugin changes these images to be HTTPS if the site is served via HTTPS
*/
if ( is_ssl() ) {
add_filter('wp_calculate_image_srcset', 'psu_https_srcset_fix' , 100 , 5);
}
function psu_https_srcset_fix( $sources, $size_array, $image_src, $image_meta, $attachment_id ){
@GogulaSivannarayana
GogulaSivannarayana / Cygwin.bat
Created January 24, 2020 18:48
starting cygwin from a specific folder, the path can be passed from windows, for example as a context-menu for folders. (you place "cygwin.bat" in your cygwin folder, replacing the old one, and run the reg file to add a context menu for each folder)
@echo off
:: set code-page for UTF-8 charset.
chcp 65001
:: normalise to fully qualified path. short path (8.3) is used for testing the path.
set FOLDER=%~s1
for /f %%a in ("%FOLDER%") do ( set "FOLDER=%%~fsa" )
:: verify existing folder.
if ["%FOLDER%"]==[""] ( goto RUN_STANDARD )
@GogulaSivannarayana
GogulaSivannarayana / Laravel.xml
Created January 24, 2020 18:11 — forked from scrubmx/Laravel.xml
PhpStorm Laravel Code Style
<code_scheme name="Laravel">
<option name="SOFT_MARGINS" value="120" />
<CssCodeStyleSettings>
<option name="HEX_COLOR_LOWER_CASE" value="true" />
<option name="HEX_COLOR_SHORT_FORMAT" value="true" />
</CssCodeStyleSettings>
<JSCodeStyleSettings version="0">
<option name="FORCE_SEMICOLON_STYLE" value="true" />
<option name="FIELD_PREFIX" value="" />
<option name="FILE_NAME_STYLE" value="CAMEL_CASE" />
<?
/* This file is released under the GPL, any version you like
*
* PHP PSD reader class, v1.3
*
* By Tim de Koning
*
* Kingsquare Information Services, 22 jan 2007
*
* example use:
@GogulaSivannarayana
GogulaSivannarayana / ZeroClipboard.js
Created September 24, 2018 19:05 — forked from cyrq/ZeroClipboard.js
DayZ SA GUID fetcher
/*!
* ZeroClipboard
* The ZeroClipboard library provides an easy way to copy text to the clipboard using an invisible Adobe Flash movie and a JavaScript interface.
* Copyright (c) 2014 Jon Rohan, James M. Greene
* Licensed MIT
* http://zeroclipboard.org/
* v2.1.6
*/
(function(window, undefined) {
"use strict";
<?php
/* vim: set expandtab tabstop=4 shiftwidth=4 softtabstop=4: */
/**
* Pure-PHP PKCS#1 (v2.1) compliant implementation of RSA.
*
* PHP versions 4 and 5
*
* Here's an example of how to encrypt and decrypt text with this library:
* <code>
@GogulaSivannarayana
GogulaSivannarayana / algorithms.php
Created September 24, 2018 18:36 — forked from hengfeiyang/algorithms.php
八大排序算法的 PHP 实现 和 效率测试
<?php
$num = 1000;
$times = 3;
$algorithms = array('insert', 'shell', 'bubble', 'quick', 'select', 'heap', 'merge', 'radix');
$arr = array();
while (count($arr) < $num) {
$key = rand(1, $num * 10);
$arr[$key] = 1;
@GogulaSivannarayana
GogulaSivannarayana / .htrouter
Created September 24, 2018 18:35 — forked from zQueal/.htrouter
bcrypt() proof of concept
<?php
if(!file_exists(__DIR__ . '/' . $_SERVER['REQUEST_URI'])){
$_GET['_url'] = $_SERVER['REQUEST_URI'];
}
return false;