Skip to content

Instantly share code, notes, and snippets.

View prayagverma's full-sized avatar
:bowtie:
Infected by an idea

Prayag Verma prayagverma

:bowtie:
Infected by an idea
View GitHub Profile
@aeron7
aeron7 / style.css
Last active January 24, 2022 07:41
Zerodha Kite Dark Mode
div.page-content.positions {
background-color: #000000;
color: #ffffff;
}
h3.page-title.small {
color: #ffffff;
}
span.text-label.small.aqua.indigo {
@taylor224
taylor224 / README.md
Last active July 5, 2018 12:32
MariaDB Auto Backup Script

MariaDB Auto Backup Script

without DB lock

@glueckpress
glueckpress / wp-rocket-example-deactivate-for-amp.php
Last active March 5, 2019 21:15
[WordPress][WP Rocket]Disable all WP Rocket functions on AMP pages created by the Automattic AMP plugin.
<?php
/**
* UNTESTED EXAMPLE!
* Please don’t use in production without having tested it before!
* @link http://wordpress.stackexchange.com/a/12165
* @return void
*/
function example__disable_rocket_cache_for_amp_pages() {
if ( ! defined( 'AMP_QUERY_VAR' ) )
return;
@joepie91
joepie91 / index.js
Last active June 23, 2023 23:42
Breaking CloudFlare's "I'm Under Attack" challenge
'use strict';
const parseExpression = require("./parse-expression");
function findAll(regex, target) {
let results = [], match;
while (match = regex.exec(target)) {
results.push(match);
}
<?php
/**
* Plugin Name: NGINX FastCGI cache purge
* Version: 0.1
* Description: Flush NGINX FastCGI cache purge
* Author: The Shipyard Crew
* Author URI: https://theshipyard.se/
* Plugin URI: https://theshipyard.se/
* Text Domain: nginx-fastcgi-cache-purge
@AvinashKrSharma
AvinashKrSharma / vimrc for how to get started with vim
Last active July 13, 2017 13:06
Initial vimrc helpful to get started with vim
" This will install Vundle
" Setting up Vundle - the vim plugin bundler
let iCanHazVundle=1
let vundle_readme=expand('~/.vim/bundle/vundle/README.md')
if !filereadable(vundle_readme)
echo "Installing Vundle.."
echo ""
silent !mkdir -p ~/.vim/bundle
silent !git clone https://github.com/VundleVim/Vundle.vim ~/.vim/bundle/vundle
let iCanHazVundle=0
@marick
marick / about_those_lava_lamps.md
Last active June 22, 2022 21:08
About Those Lava Lamps

Around 2006-2007, it was a bit of a fashion to hook lava lamps up to the build server. Normally, the green lava lamp would be on, but if the build failed, it would turn off and the red lava lamp would turn on.

By coincidence, I've actually met, about that time, (probably) the first person to hook up a lava lamp to a build server. It was Alberto Savoia, who'd founded a testing tools company (that did some very interesting things around generative testing that have basically never been noticed). Alberto had noticed that people did not react with any urgency when the build broke. They'd check in broken code and go off to something else, only reacting to the breakage they'd caused when some other programmer pulled the change and had problems.

@kangax's ES6 quiz, explained

@kangax created a new interesting quiz, this time devoted to ES6 (aka ES2015). I found this quiz very interesting and quite hard (made myself 3 mistakes on first pass).

Here we go with the explanations:

Question 1:
(function(x, f = () =&gt; x) {
@nickcernis
nickcernis / mailchimp-popup-for-wordpress.md
Last active July 28, 2022 14:49
MailChimp Popup Script that works with WordPress sites

MailChimp's default popup scripts can break on WordPress sites that use jQuery/jQuery UI unless you include their embed code as the final elements before the closing body tag.

Including them in this way isn't always possible or easy with WordPress.

The code below is an alternative implementation of the loader that forces MailChimp's popup scripts to appear below all other scripts upon page load.

To use it, modify the baseUrl, uuid, and lid attributes with the ones from the original popup script that MailChimp supplies.