Skip to content

Instantly share code, notes, and snippets.

View bagwanpankaj's full-sized avatar

Pankaj Bagwan bagwanpankaj

View GitHub Profile
@bagwanpankaj
bagwanpankaj / gulpfile.js
Created December 1, 2020 11:24 — forked from thomastuts/gulpfile.js
Splitting up Gulp tasks in separate files
// gulpfile.js
var gulp = require('gulp');
var requireDir = require('require-dir');
var tasks = requireDir('./tasks');
gulp.task('sass', tasks.sass);
gulp.task('serve:dev', tasks.serve.dev);
gulp.task('serve:dist', tasks.serve.dist);
@bagwanpankaj
bagwanpankaj / lol.js
Created February 18, 2016 12:58 — forked from wesbos/lol.js
// paste in your console
speechSynthesis.onvoiceschanged = function() {
var msg = new SpeechSynthesisUtterance();
msg.voice = this.getVoices().filter(v => v.name == 'Cellos')[0];
msg.text = Object.keys(window).join(' ');
this.speak(msg);
};
@bagwanpankaj
bagwanpankaj / gist:1c705122fa9205917033
Created January 7, 2016 16:10 — forked from hakimel/gist:9e233239b35cf5247a4e
reveal.js contained in a header
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<link rel="stylesheet" href="css/reveal.css">
<link rel="stylesheet" href="css/theme/default.css" id="theme">
</head>
<body>
@bagwanpankaj
bagwanpankaj / Instructions.md
Created October 16, 2015 16:48 — forked from kzar/Instructions.md
My Thinkpad T450 Ubuntu set up

Ubuntu 15.04 (Vivid) has now been released and it fixes mostly all of the issues I had with my Thinkpad T450. I recommend doing a clean install of Ubuntu 15.04 and mostly avoiding all of the steps bellow!

My process for getting Ubuntu running really nicely on a Thinkpad T450 with all the hardware working. (I have my track pad disabled in the bios and only want to use the track point.)

Basic steps to get Ubuntu running nicely on the Thinkpad T450:

@bagwanpankaj
bagwanpankaj / what-forces-layout.md
Created September 25, 2015 03:22 — forked from paulirish/what-forces-layout.md
What forces layout/reflow. The comprehensive list.

What forces layout / reflow

All of the below properties or methods, when requested/called in JavaScript, will trigger the browser to synchronously calculate the style and layout. This is also called reflow or layout thrashing, and is common performance bottleneck.

Element

Box metrics
  • elem.offsetLeft, elem.offsetTop, elem.offsetWidth, elem.offsetHeight, elem.offsetParent
  • elem.clientLeft, elem.clientTop, elem.clientWidth, elem.clientHeight
  • elem.getClientRects(), elem.getBoundingClientRect()
@bagwanpankaj
bagwanpankaj / ruby_windows_troubleshooting.md
Last active May 10, 2021 00:56
This gist addresses some issue identified on Windows with Rails Installer

RubyGems SSL Error

SSL_connect returned=1 errno=0 state=SSLv3 read server certificate B: certificate verify failed

This error is actually produced by changes on rubygems site certificate in lieu of recent OpenSSL vulnerabilities. To fix this error one need to upgrade their rubygems

Specific problem with RubyGems

RubyGems bundles its trust certificate within itself (as it is used from command line tool),

package main
import (
"log"
"net/mail"
"encoding/base64"
"net/smtp"
"fmt"
"strings"
@bagwanpankaj
bagwanpankaj / scripts.md
Last active August 29, 2015 14:14 — forked from myano/scripts.md

Python 101

Introduction

Welcome to Python 101 at PyOhio 2013!

Python 2.x or Python 3.x?

# mongodb.conf
# Where to store the data.
# Note: if you run mongodb as a non-root user (recommended) you may
# need to create and set permissions for this directory manually,
# e.g., if the parent directory isn't mutable by the mongodb user.
dbpath=/var/lib/mongodb
#where to log