Skip to content

Instantly share code, notes, and snippets.

🚢
coding

Tanvir Raj tanvirraj

🚢
coding
Block or report user

Report or block tanvirraj

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View axios.js
// @flow
import axios, { AxiosRequestConfig, AxiosError } from "axios";
import { message, Modal } from "antd";
import ENV from "../utils/config";
import browser from "browser-detect";
import moment from "moment-timezone";
// TODO: find a way to call custom modals programmaticaly
// See: https://github.com/ant-design/ant-design/issues/17001
// import { ErrorModal } from "../components/Modal/Modal";
View folder-structure.md

Folder Structure

Motivations

  • Clear feature ownership
  • Module usage predictibility (refactoring, maintainence, you know what's shared, what's not, prevents accidental regressions, avoids huge directories of not-actually-reusable modules, etc)
@tanvirraj
tanvirraj / 1.md
Created May 12, 2019 — forked from sw-yx/1.md
Learn In Public - 7 opinions for your tech career
View 1.md

1. Learn in public

If there's a golden rule, it's this one, so I put it first. All the other rules are more or less elaborations of this rule #1.

You already know that you will never be done learning. But most people "learn in private", and lurk. They consume content without creating any themselves. Again, that's fine, but we're here to talk about being in the top quintile. What you do here is to have a habit of creating learning exhaust. Write blogs and tutorials and cheatsheets. Speak at meetups and conferences. Ask and answer things on Stackoverflow or Reddit. (Avoid the walled gardens like Slack and Discourse, they're not public). Make Youtube videos or Twitch streams. Start a newsletter. Draw cartoons (people loooove cartoons!). Whatever your thing is, make the thing you wish you had found when you were learning. Don't judge your results by "claps" or retweets or stars or upvotes - just talk to yourself from 3 months ago. I keep an almost-daily dev blog written for no one else but me.

Guess what? It

View test.js
// @flow
import React, { PureComponent } from "react";
import styles from "./MerchantCatalogScreen.module.scss";
import { connect } from "react-redux";
import { List, Modal, message } from "antd";
import { select } from "../../../../store/store";
import { withNamespaces } from "react-i18next";
import BrowserMeta, {
Themes
View redux
// There area lot more checks in the Redux lib but this gets the point across.
function createStore(reducer, initialState) {
let currentState = initialState;
const listeners = [];
function getState() {
return currentState;
}
function subscribe(listener) {
View gist:87f342d2a8daefcce460f9cbb55afa80
{
"editor.fontFamily": "Dank Mono", //"Operator Mono",
"editor.fontSize": 16,
"editor.fontLigatures": true,
"window.zoomLevel": 1,
"editor.minimap.enabled": false,
// Controls the cursor style, accepted values are 'block', 'line' and 'underline'
// Set the default
"editor.formatOnSave": true,
View auth.post
// axios
// .post(baseURL + '/auth/local/register', {
// username: username,
// email: email,
// password: password
// })
// .then(response => {
// window.localStorage.setItem('jwt', response.data.jwt);
// if (response.statusText === 'OK') {
// this.setState(() => ({
View auth.html
<div className="signin-form">
<form onSubmit={this.handleSubmit}>
<div className="form-group">
<input
type="text"
className="form-control"
value={this.state.username}
onChange={this.handleUsername}
/>
View track-my-mac
#!/usr/bin/python
#
# trackmac.py
#
# A simple time tracker for Mac OS X by Nat Friedman (nat@nat.org).
#
# Written May 6, 2010 in Munich, while a soft rain fell.
#
# Run this script in a terminal. It displays activity statistics
# from the last 24 hours, like this:
View vscode setup
{
"editor.fontFamily": "Dank Mono", //"Operator Mono",
"editor.fontSize": 16,
"editor.fontLigatures": true,
"window.zoomLevel": 1,
"editor.minimap.enabled": false,
// Controls the cursor style, accepted values are 'block', 'line' and 'underline'
// Set the default
"editor.formatOnSave": true,
// Enable per-language
You can’t perform that action at this time.