Skip to content

Instantly share code, notes, and snippets.

#!/bin/bash
sudo apt-get install -y devilspie
mkdir -p ~/.devilspie
echo '
(if (contains (window_class) "Code")
(begin
(spawn_async (str "xprop -id " (window_xid) " -f _KDE_NET_WM_BLUR_BEHIND_REGION 32c -set _KDE_NET_WM_BLUR_BEHIND_REGION 0 "))
(spawn_async (str "xprop -id " (window_xid) " -f _NET_WM_WINDOW_OPACITY 32c -set _NET_WM_WINDOW_OPACITY 0xD8000000"))
@vishalbasnet23
vishalbasnet23 / slider.js
Created August 19, 2018 15:52 — forked from AgencySampedro/slider.js
Facetwp - Custom slider
(function($) {
/* ======== customSlider ======== */
wp.hooks.addAction('facetwp/refresh/customSlider', function($this, facet_name) {
FWP.facets[facet_name] = [];
// settings have already been loaded
if ('undefined' !== typeof FWP.used_facets[facet_name]) {
if ('undefined' !== typeof $this.find('.facetwp-customSlider')[0].noUiSlider) {
#
# Verify captcha
$post_data = http_build_query(
array(
'secret' => CAPTCHA_SECRET,
'response' => $_POST['g-recaptcha-response'],
'remoteip' => $_SERVER['REMOTE_ADDR']
)
);
$opts = array('http' =>
<?php
add_filter( 'woocommerce_bookings_in_date_range_query', 'wswp_filter_check_in_cart', 100, 1);
function wswp_filter_check_in_cart( $booking_ids ) {
foreach( $booking_ids as $key => $booking_id ) {
$booking = get_wc_booking( $booking_id );
if ( $booking->has_status( 'in-cart' ) ) {
unset( $booking_ids[$key] );
}
@vishalbasnet23
vishalbasnet23 / pmpro_customizations.php
Created July 12, 2016 05:01 — forked from strangerstudios/pmpro_customizations.php
Add a one-time-use 14 day trial to a monthly recurring membership level with Paid Memberships Pro. Place this file in wp-content/plugins/pmpro-customizations/pmpro-customizations.php on your site, then active the plugin through the WP dashboard.
<?php
/*
Plugin Name: PMPro Customizations
Plugin URI: http://www.paidmembershipspro.com/wp/pmpro-customizations/
Description: Customizations for Paid Memberships Pro (14 day trial on level 1)
Version: .1
Author: Stranger Studios
Author URI: http://www.strangerstudios.com
*/
@vishalbasnet23
vishalbasnet23 / webpack.config.js
Created April 27, 2016 06:31 — forked from learncodeacademy/webpack.config.js
Sample Basic Webpack Config
var debug = process.env.NODE_ENV !== "production";
var webpack = require('webpack');
module.exports = {
context: __dirname,
devtool: debug ? "inline-sourcemap" : null,
entry: "./js/scripts.js",
output: {
path: __dirname + "/js",
filename: "scripts.min.js"
@vishalbasnet23
vishalbasnet23 / readme.md
Created April 21, 2016 12:02 — forked from hitautodestruct/readme.md
Generate a custom structure for Wordpress menus.

This gist is for showing an example of a custom wordpress menu.

If you want to get more from the menu item simply have a look at the $item object. i.e:

// Will return a large object with lots of props like title, url, description, id etc.
var_dump( $item );

This code works on Wordpress 4.1.1 as of 31st of March 2015

/**
* Programmatically logs a user in
*
* @param string $username
* @return bool True if the login was successful; false if it wasn't
*/
function programmatic_login( $username ) {
if ( is_user_logged_in() ) {
wp_logout();

Sublime Text 2 – Useful Shortcuts (Ubuntu)

General

Ctrl+KB toggle side bar
Ctrl+Shift+P command palette
Ctrl+` python console
Ctrl+N new file

Editing

@vishalbasnet23
vishalbasnet23 / _.md
Last active August 29, 2015 14:17 — forked from klange/_.md

Since this is on Hacker News...

  • No, I don't distribute my résumé like this. A friend of mine made a joke about me being the kind of person who would do this, so I did (the link on that page was added later).
  • I apologize for the use of _t in my types. I spend a lot of time at a level where I can do that; "reserved for system libraries? I am the system libraries".
  • They're all while loops because shut up, you're overthinking a joke.