Skip to content

Instantly share code, notes, and snippets.

View debiprasad's full-sized avatar

Debiprasad Sahoo debiprasad

View GitHub Profile
@debiprasad
debiprasad / gruntfile.js
Last active June 20, 2017 11:08 — forked from pocketjoso/gruntfile.js
Critical css for PHP sites using grunt-penthouse (could use Penthouse's node module to exact same effect)
// gruntfile.js
-----------------------
// make sure you're actually running a php server locally first!
// Output a critical css file in same folder with same name as php file, just add '.css' extensions
// This makes it super easy to find from php.
penthouse: {
extract : {
css : 'pathToMyFullCss.css',
url : 'localhost:8000/work/index.php',
outfile : 'work/index.php.css',
@debiprasad
debiprasad / display-bootstrap-tab-url-hash.js
Last active September 9, 2015 08:04 — forked from anonymous/custom.js
Opens a tab other than the active tab, when the page loads using the hash in the URL. Useful, if using Bootstrap tabs.
if (location.hash) {
var hashId = location.hash;
if ($('a[href="' + hashId + '"]').length > 0) {
$('a[href="' + hashId + '"]').click();
}
}