Skip to content

Instantly share code, notes, and snippets.

View addnab's full-sized avatar
🏒

Abdud Dayan Adeeb addnab

🏒
View GitHub Profile
@addnab
addnab / zeppelin-site.xml
Last active October 14, 2017 18:28
Amazon S3 notebook storage for Zeppelin
...
<!-- Amazon S3 notebook storage -->
<!-- Creates the following directory structure: s3://{bucket}/{username}/{notebook-id}/note.json -->
<property>
<name>zeppelin.notebook.s3.user</name>
<value>*FOLDER*</value>
<description>user name for s3 folder structure</description>
</property>
<property>
@addnab
addnab / puppeteer-headless.js
Last active September 25, 2017 02:02
Fix puppeteer headers for differences between chrome and chrome headless
const browser = await puppeteer.launch();
const page = await browser.newPage();
const headlessUserAgent = await page.evaluate(() => navigator.userAgent);
const chromeUserAgent = headlessUserAgent.replace('HeadlessChrome', 'Chrome');
await page.setUserAgent(chromeUserAgent);
await page.setExtraHTTPHeaders({
'accept-language': 'en-US,en;q=0.8'
});
@addnab
addnab / MyPromise.js
Last active September 16, 2017 21:17
My minimal promise implementation
const PENDING = 0;
const FULFILLED = 1;
const REJECTED = 2;
class MyPromise {
constructor(fn) {
this.status = PENDING;
process.nextTick(() => {
fn(payload => {
this.status = FULFILLED;
@addnab
addnab / install_sublime_text.sh
Last active August 29, 2015 14:02 — forked from simonewebdesign/install_sublime_text.sh
Sublime working with Application Drawer
#!/bin/sh
# Sublime Text 3 install with Package Control
# http://simonewebdesign.it/blog/install-sublime-text-3-on-fedora-20/
# Run this script with:
# $ curl LINK_TO_THIS_SCRIPT | sh
curl -o ~/st3.tar.bz2 http://c758482.r82.cf2.rackcdn.com/sublime_text_3_build_3059_x64.tar.bz2