Skip to content

Instantly share code, notes, and snippets.

@tomhemsley
tomhemsley / gist:e985db339da947fa035d
Created August 5, 2014 12:33
Meta Slider Change Capability / User Role Editor
/**
* The default capability required to use Meta Slider is 'edit_others_posts'.
* You can change this to a different capability by pasting the code below into
* your themes functions.php file.
*
* You can use the 'User Role Editor' plugin to add a custom capability to WordPress
* specifically for Meta Slider users.
*/
function metaslider_change_required_role($capability) {
return 'metaslider_use'; // this is the ID of a custom capability added using User Role Editor
@willmot
willmot / termmeta.php
Last active May 6, 2016 22:32
Add termmeta support to WordPress including a termmeta table and all the standard WordPress metadata functions
<?php
/**
* Setup the termmeta table
*
* Use <code>add_theme_support( 'term-meta' );</code> to enable support for term meta
*/
function hm_add_term_meta_table() {
global $wpdb;
@stevedev
stevedev / gist:1097432
Created July 21, 2011 15:25
Facebook Cheatsheet
@hameedullah
hameedullah / customtaxonomydropdown.php
Created May 28, 2011 23:50
Custom Taxonomy drop downs for parents and child
<?php
/*
Plugin Name: Custom Taxonomy DropDown
Author: Hameedullah Khan
Aurhot URI: http://hameedullah.com
*/
// change this to your taxonomy
$brand_taxonomy = 'category';
@bamanzi
bamanzi / zsh-git-prompt.sh
Created June 27, 2013 09:43
zsh: show git repo name, branch in right prompt
# although StackOverflow has this answer http://stackoverflow.com/a/1128583
# but that code is unreadable, thus I have this (also based on a SO anower: http://stackoverflow.com/a/1128721 )
# get the name of the branch we are on
_git_repo_name() {
gittopdir=$(git rev-parse --git-dir 2> /dev/null)
if [[ "foo$gittopdir" == "foo.git" ]]; then
echo `basename $(pwd)`
elif [[ "foo$gittopdir" != "foo" ]]; then
echo `dirname $gittopdir | xargs basename`
#!/bin/bash
#
# Docker Daemon varsayilan olarak ag iletisimi olmadan
# sadece Unix socket uzerinden calismaktadir.
# Docker Client ve Daemon arasinda HTTPS uzerinden
# guvenli iletisimin kurulmasi icin TLS aktif hale getirilmelidir.
# Client ve Server/daemon arasindaki guvenli iletisim agi
# icin gereken client ve server sertifikasyonlarini
# olusturmaliyiz.
#
let NETWORK_PRESETS = {
'GPRS': {
'offline': false,
'downloadThroughput': 50 * 1024 / 8,
'uploadThroughput': 20 * 1024 / 8,
'latency': 500
},
'Regular2G': {
'offline': false,
'downloadThroughput': 250 * 1024 / 8,
@alexyoung
alexyoung / .vimrc
Created May 16, 2012 11:12
mouse-vimrc
" vim:fdm=marker
" Editor basics {{{
" Behave like Vim instead of Vi
set nocompatible
" Show a status line
set laststatus=2
" Show the current cursor position
@boogah
boogah / WP_Bag_of_Tricks.txt
Created April 30, 2010 00:51
Things I've learned by being a WordPress nerd.
WP Bag of Tricks
1. Helpful Scripts/Plugins:
Hacks:
http://wordpress.org/extend/plugins/tac/
http://wordpress.org/extend/plugins/exploit-scanner/ (Can be extremely resource intensive.)
http://wordpress.org/extend/plugins/wp-malwatch/
@stvar
stvar / youtube-search.py
Last active June 20, 2023 14:23
Find YouTube channel IDs by custom URLs or user names
#!/usr/bin/python3
# Copyright (C) 2020 Stefan Vargyas
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions: