This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import { connect } from 'react-redux'; | |
| const = MyComponent => (props) { | |
| console.log(props.reduxState); | |
| return null; | |
| } | |
| const mapStateToProps = function(state) { | |
| return { | |
| reduxState: state, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| const state = {} | |
| ... | |
| const myReducer = ({ action, data }) => { | |
| switch (action) { | |
| case 'A_STRING_REPRESENTING_AN_ACTION': | |
| return { | |
| ...state, | |
| //some modifications based on 'data' | |
| } | |
| default: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/sh | |
| print_pgp_key() { | |
| cat <<-EOF | |
| -----BEGIN PGP PUBLIC KEY BLOCK----- | |
| mQINBFDAy/0BEAC8I5bw5gLQqHKx5JCacYcXFL6AZowl3qIOTxo5yfBl8CepNpWY | |
| OOERvIUJb17WehhhbWOo9WjpBalDXBRtI1NvfArewOT8fLm7BdhYe8U45moBfkYi | |
| xFtNrPw3pdIltHQISrB8PufhliN8obQuq0rcxYV8NblvYo4gIGNjBfO1QGvBNmp7 | |
| kBtjlAuZguScZmUTdPOwfv8fqN52X9tCv1ahQk1hg8XG9YwW0vXb5z93jkLXBb5b |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # ref : https://github.com/slackapi/python-slackclient | |
| import sys | |
| import uuid | |
| import slack | |
| from lib.py.core.config import Config | |
| slack_token = Config()["slackbot"]["user_token"] | |
| authorized_users = Config()["slackbot"]["authorized_user_ids"] | |
| client = slack.WebClient(slack_token) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| @echo off | |
| set PYTHONPATH=%~dp0..\.. | |
| python %~dp0..\py\dependencies.py %* | |
| REM cli dep %* |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| class Portfolio: | |
| AGE=29 # Starting year | |
| CTC=1000000 # Total CTC, it's assumed that only 75% comes in hand | |
| HIKE=100000 # Assuming 1 lakh hike every year | |
| RETURNS_PER_ANNUM = 1.10 # Assuming investment returns are 10% per annum | |
| EXPENSES_PER_MONTH = 40000 # Assuming monthly expenses are 40k, inflation taken into account while calculating though | |
| INFLATION=1.07 # Assuming 7% inflation | |
| ASSETS=0 # Assuming there's no investment so far | |
| DURATION=50 # Assuming death after 50 years |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // ==UserScript== | |
| // @name Emby - local path | |
| // @namespace http://tampermonkey.net/ | |
| // @version 0.1 | |
| // @description try to take over the world! | |
| // @author You | |
| // @match http://localhost:8096/* | |
| // @grant none | |
| // @require http://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js | |
| // ==/UserScript== |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| cd "C:%HOMEPATH%\.IntelliJIdea*\config" | |
| rmdir "eval" /s /q | |
| del "options\options.xml" | |
| reg delete "HKEY_CURRENT_USER\Software\JavaSoft\Prefs\jetbrains\idea" /f | |
| :: It is Highly Advised to Purchase the JetBrain Softwares | |
| :: This is only for the case You just want to Extend the | |
| :: Trial Period and Evaluate the IDE for some more Time |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| apt-get install git | |
| add-apt-repository ppa:nathan-renniewaldock/flux | |
| apt-get install git | |
| sudo apt-get install python-pip | |
| git clone "https://github.com/xflux-gui/fluxgui.git" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| def mainFile(): | |
| f = open("CodeChefInput.txt", "r") | |
| f.readline() | |
| def nextLine(): | |
| line = f.readline() | |
| elems = line.split() | |
| if len(elems) < 2: | |
| return int(line) | |
| else: | |
| for idx in range(len(elems)): |