Skip to content

Instantly share code, notes, and snippets.

View varunsridharan's full-sized avatar
😀

Varun Sridharan varunsridharan

😀
View GitHub Profile
@ankurk91
ankurk91 / github_gpg_key.md
Last active April 9, 2024 16:34
Signing git commits using GPG (Ubuntu/Mac)

Github : Signing commits using GPG (Ubuntu/Mac) 🔐

  • Do you have an Github account ? If not create one.
  • Install required tools
  • Latest Git Client
  • gpg tools
# Ubuntu
sudo apt-get install gpa seahorse
# MacOS with https://brew.sh/
<?php
/**
* Escape all translations with
*/
__( ‘Some String’, ‘text-domain’ ); _e( ‘Some string’, ‘text-domain’ );.
/**
* When there is no HTML use:
*/
@jacks0n
jacks0n / wp-auto-login.php
Last active November 19, 2023 16:35
Automatically login to WordPress, with a given user and optionally whitelist IPs. Add this to the bottom of wp-config.php, or your theme functions.php. To automatically login, visit the admin login page (/wp-login.php or /wp-admin/).
/**
* Automatically logs in a visitor when accessing the admin login area (/wp-login.php)
*
* @copyright Copyright (c) 2014, Jackson Cooper
* @license MIT
*
* Whitelist IPs: add IPs to whitelist in $ip_whitelist. If it is empty, it will allow all IPs.
* Username: Specify the username to login as with the "user" GET parameter (eg. ?user=admin).
* If the "user" get parameter is not set, $default_user_login will be used. If set
* to "*", it will login as the first administrator found. Otherwise it will use the
@tleish
tleish / mysql_backup.sh
Last active April 24, 2024 13:00
Bash Script to backup all MySQL databases
#!/bin/bash
#==============================================================================
#TITLE: mysql_backup.sh
#DESCRIPTION: script for automating the daily mysql backups on development computer
#AUTHOR: tleish
#DATE: 2013-12-20
#VERSION: 0.4
#USAGE: ./mysql_backup.sh
#CRON:
# example cron for daily db backup @ 9:15 am
@pixeline
pixeline / .gitignore
Last active October 25, 2022 01:41 — forked from redoPop/.gitignore
Default Wordpress .gitignore file
# This is a template .gitignore file for git-managed WordPress projects.
#
# Fact: you don't want WordPress core files, or your server-specific
# configuration files etc., in your project's repository. You just don't.
#
# Solution: stick this file up your repository root (which it assumes is
# also the WordPress root directory) and add exceptions for any plugins,
# themes, and other directories that should be under version control.
#
# See the comments below for more info on how to add exceptions for your
package com.frogsparks.mytrails.util;
import android.os.Environment;
import com.frogsparks.mytrails.MyTrails;
import java.io.File;
import java.util.*;
// http://stackoverflow.com/a/15612964/304876
@lucaspiller
lucaspiller / auto-save-remote-images.php
Created February 19, 2014 15:19
Auto Save Remote Images WP Plugin
<?php
/*
Plugin Name: Auto Save Remote Image
Plugin URI: http://www.devsaab.com/wordpress/
Description: This plugin automatically downloads the first remote image from a post and sets it as the featured image.
Version: 1.3
Author: Prebhdev Singh
Disclaimer: No warranty or guarantee of any kind! Use this in your own risk.
*/
add_action('publish_post', 'fetch_images');
@pixeline
pixeline / index.html
Last active May 26, 2019 03:44
Simple way to implement a stylesheet switcher, using jquery and proper html. Add your stylesheets to your <head> tag: <link rel="alternate stylesheet" title="red" href="css/red.css" type="text/css"> Include the jquery stylesheet switcher. Done.
<!DOCTYPE html>
<html class="no-js">
<head>
<meta charset="utf-8">
<link rel="stylesheet" title="main" href="normalize.min.css" type="text/css">
<link rel="stylesheet" title="main" href="main.css" type="text/css">
<link rel="alternate stylesheet" title="red" href="red.css" type="text/css">
<link rel="alternate stylesheet" title="blue" href="blue.css" type="text/css">
@erlendmr
erlendmr / js-moving-from-jquery-to-vanilla-js.md
Last active September 9, 2020 11:05 — forked from liamcurry/gist:2597326
Moving from jQuery to Vanilla JS

Moving from jQuery

Events

// jQuery
$(document).ready(function() {
  // code
})