Skip to content

Instantly share code, notes, and snippets.

Prashant Palikhe prashantpalikhe

Block or report user

Report or block prashantpalikhe

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View plugin.js
const imagemin = require('imagemin');
const webp = require('imagemin-webp');
const GREEN = '\x1b[32m%s\x1b[0m';
const RED = '\x1b[31m%s\x1b[0m';
class ImageminWebpWebpackPlugin {
constructor({
config = [
{
@prashantpalikhe
prashantpalikhe / skip_intro.js
Created Jul 31, 2018
Auto skip Netflix intro
View skip_intro.js
// ==UserScript==
// @name Auto skip Netflix intro
// @namespace http://tampermonkey.net/
// @version 1.0
// @description Automatically clicks on the "Skip intro" button in Netflix
// @author Prashant Palikhe
// @match https://www.netflix.com/*
// @grant none
// ==/UserScript==
@prashantpalikhe
prashantpalikhe / traceProperty.js
Created Jul 25, 2018
Devtools snippet to trace property access
View traceProperty.js
const traceProperty = (object, property) => {
let value = object[property];
Object.defineProperty(object, property, {
get () {
console.trace(`${property} requested`);
return value;
},
set (newValue) {
console.trace(`setting ${property} to `, newValue);
value = newValue;
@prashantpalikhe
prashantpalikhe / lodashify.js
Created Jul 24, 2018
Lodashify chrome devtools snippet
View lodashify.js
(function () {
'use strict';
var element = document.createElement('script');
element.src = "https://cdnjs.cloudflare.com/ajax/libs/lodash.js/4.15.0/lodash.min.js";
element.type = "text/javascript";
document.head.appendChild(element);
})();
@prashantpalikhe
prashantpalikhe / devtools_$$.js
Created Jul 23, 2018
Using $$ in Chrome devtools console to detect broken links
View devtools_$$.js
Promise
.all(
$$('a')
.map(link => link.href)
.map(href => fetch(href))
)
.then(() => console.log('All links working'))
.catch(() => console.error('Some links are broken'));
View htaccess-ip-lock
# Welcome to your htaccess file.
# Remember that modifying this file can break the entire website
# so please edit carefully.
# Also remember that the order of the rules below does matter,
# so be sure of what you're doing before shuffling things around.
AuthType Basic
AuthName "My Dev Environment"
# Specify what user/password file the server should look
View php.ini
[php]
default_charset="UTF-8"
realpath_cache_size=4096K
realpath_cache_ttl=7200
post_max_size=128M
upload_max_filesize=128M
file_uploads=1
View README.md

##Auto-deploy with php and github on an Ubuntu Amazon EC2 box

Fork from other gist Build auto-deploy with php and git(hub) on an EC2 AMAZON AMI instance - Covers a basic Ubuntu isntall

When ever it says www-data below, it's the user Apache runs under. So if your apache user is called something else, change it to that.

##Install git

sudo aptitude install git-core
View gist:d668c7889ac33ca49982
{
"always_show_minimap_viewport": true,
"color_scheme": "Packages/Color Scheme - Default/Monokai.tmTheme",
"default_line_ending": "unix",
"detect_indentation": false,
"ensure_newline_at_eof_on_save": true,
"find_selected_text": true,
"font_size": 10,
"highlight_line": true,
"highlight_modified_tabs": true,
You can’t perform that action at this time.