Skip to content

Instantly share code, notes, and snippets.

View sudarshang's full-sized avatar

Sudarshan Gaikaiwari sudarshang

View GitHub Profile
const WebpackBundleAnalyzer = require("webpack-bundle-analyzer")
.BundleAnalyzerPlugin;
module.exports = () => ({
plugins: [new WebpackBundleAnalyzer()]
});
plugins: [
...
...
...
config.bundleAnalyzer && !isNode && new BundleAnalyzerPlugin(),]
@sudarshang
sudarshang / webpack.config.js
Created May 10, 2018 15:28
webpack none mode
module.exports = {
mode: "none"
}
@sudarshang
sudarshang / meta.js
Created May 2, 2018 12:37
A component for Meta tags in react-static
'use strict';
import React from 'react'
import { Head } from 'react-static'
const Meta = (props) => (
<Head>
<title>{props.title ? `${props.title} - ` : ""}My Site</title>
<meta itemProp="name" content={props.title ? props.title : "My Site Title"}/>
#!/bin/bash
# Start a new bash shell with a severely filtered environment and no initfile.
if [ -z "$_BFR_RUNNING" ]; then
env -i \
_BFR_RUNNING=1 \
PATH="$PATH" \
LD_LIBRARY_PATH="$LD_LIBRARY_PATH" \
TERM="$TERM" \
SHELL="$SHELL" \
@sudarshang
sudarshang / css_in_js_to_styled_component.js
Created March 22, 2018 17:00
Convert css in js to styled component
video = {
width: '100%',
verticalAlign: 'bottom',
maxHeight: '508px',
objectFit: 'contain',
background: '#000000',
}
camelCaseToDash = (str) => str.replace(/([A-Z])/g, (g) => `-${g[0].toLowerCase()}`);
class WithAGeneratorAfterAProperty {
public foo: string = "1";
- *blah() {
- }
+ *blah() {
+ }
}
class WithAGeneratorAfterAnotherMethod {
-- typescript-mode-org.el 2017-07-08 07:28:40.804849539 -0500
;;; js-mode.el --- Major mode for editing js
;; -----------------------------------------------------------------------------------
;; Js support for Emacs
;; Unmodified original sourve available at http://www.karllandstrom.se/downloads/emacs/javascript.el
;; Copyright (c) 2008 Free Software Foundation
;; Portions Copyright (C) Microsoft Open Technologies, Inc. All rights reserved.
;;
;; This program is free software: you can redistribute it and/or modify
;; it under the terms of the GNU General Public License as published by
In [1]: import sys
...: sys.path.append('/home/smg/Dropbox/projects/jedi_import_error/')
...: import jedi
...: jedi.set_debug_function()
...:
In [2]: s = jedi.Script(source='from jedi_import_error._jedi_import_counter import JediImportCounter')
...: s.goto_definitions()
...:
speed: init 0.0548539161682
I am running into a problem while trying to upgrade to mrjob 0.4.2. While a solution to this problem would be great, I am also interested in learning if there is a way to debug the wrapper script on emr. I am able to ssh to the emr hadoop cluster. However I have not figured out how to execute the wrapper script using the same environment that hadoop sets up when it is running it as part of the mapper process.
Here are the setup_cmds in my mrjob.conf file.
setup_cmds: &setup_cmds
- cd sudarshan-src-tree.tar.gz; make -f Makefile.emr
- mkdir -p sudarshan-src-tree.tar.gz/srv-configs
- ln -sf $(readlink -f sudarshan.yaml) sudarshan-src-tree.tar.gz/srv-configs/sudarshan.yaml
- ln -sf $(readlink -f sudarshan-config-spark.yaml) sudarshan-src-tree.tar.gz/srv-configs/sudarshan-config-spark.yaml