Skip to content

Instantly share code, notes, and snippets.

View pratheekhegde's full-sized avatar
💆‍♂️
Need a head massage badly.

pTk pratheekhegde

💆‍♂️
Need a head massage badly.
View GitHub Profile

Keybase proof

I hereby claim:

  • I am pratheekhegde on github.
  • I am pratheekhegde (https://keybase.io/pratheekhegde) on keybase.
  • I have a public key whose fingerprint is 3B23 73B2 AE6C 89E2 7F86 B480 0F23 2484 3A7B 33D6

To claim this, I am signing this object:

@pratheekhegde
pratheekhegde / python_phantom_jinga_pdf.py
Created September 23, 2016 18:00
Generate PDF with Python using PhantomJS and Jinga
#!/usr/bin/env python
'''
Created on 22 Sep 2016
@author: phegde
'''
from subprocess import call
#from string import Template
<h1> Hola!, My name is $fullName.</h1>
{
"fullName": "Pratheek Hegde"
}
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# encoding=utf8
'''
Created on 22 Sep 2016
@author: phegde
'''
from subprocess import call
@pratheekhegde
pratheekhegde / angular_download_pdf.js
Created October 27, 2016 13:44
Download PDF in angular
pdf: $resource(ENV.mainUrl + '/filestack/pdf',
null, {
send: {
method: 'POST',
// timeout: POST_TIMEOUT,
responseType: 'arraybuffer',
headers: {
'Content-Type': 'application/pdf',
'Accept': 'application/pdf'
},
0x3669705eFC786353889246e0AC5e09FF4EABA0C8
@pratheekhegde
pratheekhegde / hide_show_github_comments.js
Created October 14, 2017 08:02
Hide or show Comments in Github
// hide comments
var comments = $$(".pl-c");
for (c in comments) {
comments[c].parentNode.parentNode.style.display='none';
}
// show comments
var comments = $$(".pl-c");
@pratheekhegde
pratheekhegde / bread-crumbs-array.js
Created February 17, 2018 08:37
create-breadcrumbs-array
let breadcrumbs = pathArray.reduce((breadcrumbArray, path, idx) => {
breadcrumbArray.push({
path: path,
to: breadcrumbArray[idx - 1]
? "/" + breadcrumbArray[idx - 1].path + "/" + path
: "/" + path,
text: this.$route.matched[idx].meta.breadCrumb || path,
});
return breadcrumbArray;
}, [])
const router = new Router({
routes: [
{
path: '/',
component: HelloWorld,
meta: {
breadCrumb: 'Hello World' //crumb
}
},
{