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()
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?

#you can copy this into IRB or just run it as a file
require "net/http"
require "uri"
url = "http://localhost:3000/login"
yaml = %{ --- !ruby/object:Time {} }
xml = %{<?xml version="1.0" encoding="UTF-8"?><foo type="yaml">#{yaml}</foo>}.strip
uri = URI.parse(url)
@bagwanpankaj
bagwanpankaj / pgDebug.js
Created August 5, 2011 09:36 — forked from purplecabbage/pgDebug.js
Workout your iPhone PhoneGap UI in Desktop Safari
var safariDebug = ( navigator.platform.indexOf("iPhone") < 0 && navigator.platform.indexOf("iPod") < 0 && navigator.platform.indexOf("iPad") < 0 );
if(safariDebug)
{
PhoneGap.run_command = function()
{
if (!PhoneGap.available || !PhoneGap.queue.ready)
return;