Skip to content

Instantly share code, notes, and snippets.

View prashantpalikhe's full-sized avatar

Prashant Palikhe prashantpalikhe

View GitHub Profile
@prashantpalikhe
prashantpalikhe / gist:d668c7889ac33ca49982
Last active December 22, 2015 01:39
My Sublime Preferences
{
"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,

##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
[php]
default_charset="UTF-8"
realpath_cache_size=4096K
realpath_cache_ttl=7200
post_max_size=128M
upload_max_filesize=128M
file_uploads=1
# 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
@prashantpalikhe
prashantpalikhe / devtools_$$.js
Created July 23, 2018 19:31
Using $$ in Chrome devtools console to detect broken links
Promise
.all(
$$('a')
.map(link => link.href)
.map(href => fetch(href))
)
.then(() => console.log('All links working'))
.catch(() => console.error('Some links are broken'));
@prashantpalikhe
prashantpalikhe / lodashify.js
Created July 24, 2018 21:07
Lodashify chrome devtools snippet
(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 / traceProperty.js
Created July 25, 2018 08:48
Devtools snippet to trace property access
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 / skip_intro.js
Created July 31, 2018 21:23
Auto skip Netflix intro
// ==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==
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 / contentful-master-branch-warn.js
Last active June 19, 2023 15:39
Warn on Master branch on Contentful
// ==UserScript==
// @name Contentful Master Branch Alert
// @namespace http://tampermonkey.net/
// @version 1.4
// @description Show an alert when on the master branch of Contentful
// @author Prashant Palikhe
// @match https://app.contentful.com/spaces/*
// @grant none
// ==/UserScript==