Skip to content

Instantly share code, notes, and snippets.

View junaidkbr's full-sized avatar
🔥

Junaid Ahmed junaidkbr

🔥
View GitHub Profile
window.i18n = window.i18n || {};
i18n._langCache = {}
i18n._availableLangs = [
'en',
'zh-TW',
'ja'
]
@solepixel
solepixel / activate-plugin.php
Created August 26, 2016 15:22
Originally design to activate Andrew Norcross's Airplane Mode plugin (https://github.com/norcross/airplane-mode), this little script will allow you to activate a plugin when the WordPress admin plugin screen cannot be loaded, for whatever reason.
<?php
/**
* This file will activate the Airplane Mode plugin if not already activated. This is helpful when you do not have internet connection and you're unable to reach the WP Admin Plugins page to activate the plugin.
*/
// get WP bootstrap
define('WP_USE_THEMES', false);
require(__DIR__ . '/wp/wp-blog-header.php');
@ziemekpr0
ziemekpr0 / post-cf7-form.php
Last active October 25, 2017 01:08
WordPress snippet - its a simple plugin which instead of sending e-mail, saves given post data as a post content. In this stage it is not dynamic and require some preparations in order to make it work.:)
<?php
/**
* Plugin Name: Post Form
* Description: Umożliwia dodanie wysłanego formularza jako postu w kokpicie do przeglądu.
* Version: 1.0
* Author: ziemekpr0
* Author Email: [email protected]
* Author URI: http://wpadmin.pl
* License: GPLv2 or later
*/
@mhull
mhull / Draggable.html
Last active October 13, 2017 05:02
Draggable elements that have been styled to indicate draggability to users
<!-- CSS Stylesheet -->
<link rel='stylesheet' type='text/css' href='css/draggable.css' />
<!-- The things we are dragging -->
<div class='thing'><label>Thing 1</label></div>
<div class='thing'><label>Thing 2</label></div>
<div class='thing'><label>Thing 3</label></div>
<!-- jQuery and jQuery-UI -->
<script src="//ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js"></script>
@cartpauj
cartpauj / memberpress-hide-password-fields.php
Last active March 23, 2020 14:24
Unset the password fields errors from MemberPress and auto-generate the user pass instead
<?php
//This file only unsets the errors
//You'll still need to override the app/views/checkout/form.php file to remove the password fields HTML
//You can find instructions on overriding template files here: https://www.memberpress.com/1.1.7
function unset_password_validation_errors($errors) {
if(empty($errors)) { return $errors; } //Should never happen if the password fields are hidden
//Unset the password field errors
// IF YOU'VE TRANSLATED THE PLUGIN - YOU MAY NEED TO CHANGE THESE ENGLISH TEXTS TO YOUR LANGUAGE
foreach($errors as $i => $v) {
@adikahorvath
adikahorvath / input-decorations.css
Created October 21, 2015 13:57
remove input type="date" arrows
input[type=date]::-webkit-inner-spin-button,
input[type=date]::-webkit-outer-spin-button {
-webkit-appearance: none;
}
@R41D3NN
R41D3NN / get-ipinfo.js
Last active May 21, 2023 00:51
Javascript for retrieving IP Address info using ipinfo.io API via AJAX.
var GetIpInfo = function(ipAddr) {
var info = null;
var infoUrl = "http://ipinfo.io/" + ipAddr;
$.ajax({
url: infoUrl,
type: 'GET',
dataType: 'json',
async: false,
success: function(data) {
info = data;
@ainsofs
ainsofs / gist:2b80771a5582b7528d9e
Created April 16, 2015 01:50
Clear .gitignore cache
# remove specific file from git cache
git rm --cached filename
# remove all files from git cache
git rm -r --cached .
git add .
git commit -m ".gitignore is now working"
@ccurtin
ccurtin / Custom Social Sharing Buttons for Wordpress Shortcode.php
Last active May 8, 2023 19:31
Custom Social Sharing Buttons for Wordpress
<?php
/*
http://stackoverflow.com/questions/12448134/social-share-links-with-custom-icons
http://petragregorova.com/articles/social-share-buttons-with-custom-icons
wp_enqueue_style('fontAwesome', '//cdnjs.cloudflare.com/ajax/libs/font-awesome/4.3.0/css/font-awesome.min.css', array(), '4.3.0', 'all');
use in template files:: <?php echo do_shortcode('[social_sharing]') ; ?>
*/
@caseywatts
caseywatts / bookmarkleting.md
Last active August 25, 2025 17:49
Making Bookmarklets

This is one chapter of my "Chrome Extension Workshops" tutorial, see the rest here: https://gist.github.com/caseywatts/8eec8ff974dee9f3b247

Unrelated update: my book is out! Debugging Your Brain is an applied psychology / self-help book

Making Bookmarklets

I'm feeling very clever. I've got this sweet line of javascript that replaces "cloud" with "butt". My mom would LOVE this, but she doesn't computer very well. I'm afraid to show her the Developer Console and have her type/paste this in. But she IS pretty good at bookmarks, she knows just how to click those!

A bookmark normally takes you to a new web page. A bookmarklet is a bookmark that runs javascript on the current page instead of taking you to a new page. To declare that it is a bookmarklet, the "location" it points to starts with javascript:.