Skip to content

Instantly share code, notes, and snippets.

Avatar

Tunbosun Ayinla tubiz

View GitHub Profile
@tubiz
tubiz / affwp-pms-restrict-referral.php
Created Nov 8, 2018
Allows you to restrict referral creation to specific PMS subscription plans
View affwp-pms-restrict-referral.php
<?php
/**
* Plugin Name: AffiliateWP - Restrict Referral Creation To Specific PMS Subscription Plans
* Plugin URI: http://affiliatewp.com
* Description: Allows you to restrict referral creation to specific PMS subscription plans
* Author: Tunbosun Ayinla, tubiz
* Author URI: https://bosun.me
* Version: 1.0
*/
View udemy-courses-download-using-cookies.md

Download Udemy course videos using youtube-dl

$ youtube-dl --list-extractors | grep udemy

Steps

  1. Get link to the course to download. e.g. https://www.udemy.com/course-name/
  2. Login into udemy website, save the cookie from chrome using Chrome (Cookie.txt)[1] export extension. Save it to file udemy-cookies.txt
  3. Get the link of the video that you want to download. usually in format. Use the command provided below where you have to replace the {course_link} and {path_to_cookies_file} with respective paths.

# $ youtube-dl {course_link} --cookies {path_to_cookies_file}

@tubiz
tubiz / README.md
Created Sep 29, 2016 — forked from magnetikonline/README.md
Using Dnsmasq with Ubuntu 16.04LTS/14.04LTS/12.04LTS for virtual machine web application testing.
View README.md

Using Dnsmasq with Ubuntu for VM web application testing

When running virtual machines under a Linux host system for testing web apps in various browsers (e.g. Internet Explorer), I found it rather tedious having to continually tweak the hosts file within each VM for the purpose of adding entries pointing back to the host machine's development web server address.

Instead the steps below will setup Dnsmasq on a Ubuntu 16.04LTS, 14.04LTS or 12.04LTS host machine for the purpose of serving both it's own DNS queries and that of virtual machine guests. Dnsmasq will parse the /etc/hosts file on your host machine where we will keep a single set of DNS entires to our test web application(s).

View new_gist_file
<div class="fake-input" data-input="Input1" style="background: url('/img/blabla.jpg');">Select your file</div>
<div class="fake-input" data-input="Input2" style="background: url('/img/blabla.jpg');">Select your file</div>
<div class="fake-input" data-input="Input3" style="background: url('/img/blabla.jpg');">Select your file</div>
<input id="Input1" type="file" style="display:none" />
<input id="Input2" type="file" style="display:none" />
<input id="Input3" type="file" style="display:none" />
<script type="text/javascript">
$(document).on('click', '.fake-input', function(e) {
console.log($('#' + $(this).data('input')));
$('#' + $(this).data('input')).click();
@tubiz
tubiz / 0_reuse_code.js
Created Oct 22, 2013
Here are some things you can do with Gists in GistBox.
View 0_reuse_code.js
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
@tubiz
tubiz / Pagination On WordPress Custom Page Template
Created Aug 18, 2013
Making pagination works in custom page template in WordPress.
View Pagination On WordPress Custom Page Template
<?php
global $paged;
$paged = (get_query_var('page')) ? get_query_var('page') : 1;
$args = array( 'post_type' => array('post'), 'paged' => $paged);
$wp_query = new WP_Query( $args );
if( $wp_query->have_posts() ):
while ( $wp_query->have_posts() ) : $wp_query->the_post();
?>
<div class="post">
<?php the_title(); ?>
View wp-query-ref.php
<?php
/**
* WordPress Query Comprehensive Reference
* Compiled by luetkemj - luetkemj.com
*
* CODEX: http://codex.wordpress.org/Class_Reference/WP_Query
* Source: http://core.trac.wordpress.org/browser/tags/3.3.1/wp-includes/query.php
*/
$args = array(
@tubiz
tubiz / meta-tags.md
Created Oct 5, 2012 — forked from kevinSuttle/meta-tags.md
Complete List of HTML Meta Tags
View meta-tags.md

Copied from http://code.lancepollard.com/complete-list-of-html-meta-tags/

Basic HTML Meta Tags

<meta charset='UTF-8'>
<meta name='keywords' content='your, tags'>
<meta name='description' content='150 words'>
<meta name='subject' content='your website's subject'>
<meta name='copyright' content='company name'>
View gist:3778073
$paged = get_query_var ('paged');
$args = array( 'post_type' => array('post'),'paged' => $paged, 'caller_get_posts' => 1, 'post__not_in' => get_option('sticky_posts') );
$loop = new WP_Query( $args );
You can’t perform that action at this time.