Skip to content

Instantly share code, notes, and snippets.

View yehudamakarov's full-sized avatar
🎯
Focusing

Yehuda Makarov yehudamakarov

🎯
Focusing
View GitHub Profile
@yehudamakarov
yehudamakarov / readme.md
Last active November 22, 2018 16:43 — forked from benstr/readme.md
Gist Markdown Cheatsheet

#Heading 1 ##Heading 2 ###Heading 3 ####Heading 4 #####Heading 5 ######Heading 6


Paragraph

@yehudamakarov
yehudamakarov / ChumashModel.ts
Last active May 3, 2019 02:05
[Typescript Mongoose]
import mongoose, { Document, Model } from "mongoose";
import { IRashiDocument, IRashiObject, RashiSchema } from "./Rashi";
export interface IChumashObject {
learnOnDate: Date;
dayOfTheWeek: string;
hebrewPesukim: Pesukim;
englishPesukim: Pesukim;
amountOfPesukim: number | null;
rashiDocument: IRashiObject;
@yehudamakarov
yehudamakarov / symlink.md
Last active May 3, 2019 02:04
[Bash Commands] bash commans that may need to be used
@yehudamakarov
yehudamakarov / nodemon.json
Last active May 3, 2019 02:07
[Config Files] config settings that may need to be used in various places
{
"ignore": ["**/*.test.ts", "**/*.spec.ts", ".git", "node_modules"],
"watch": ["src"],
"exec": "npm start",
// probably just extension...
"ext": "ts"
}
// and in package.json:
@yehudamakarov
yehudamakarov / DoubleTap.js
Last active May 7, 2019 02:42
[React Recipes]
import React from 'react';
import { TouchableWithoutFeedback } from 'react-native';
export default class DoubleTap extends React.Component {
static defaultProps = {
delay: 300,
onDoubleTap: () => null,
};

The problem is that it's risky, because your local changes are seen by git as diffs relative to the current branch tip, but those diffs may not be applicable to the other branch. For instance if you added a line after an existing line, and that line doesn't exist on the other branch, git won't know what to do From the command line you can do git checkout -m branch which attempts a "merge" algorithm, which may work, or else give you a mess of merge conflict markers Otherwise you can stash your changes, and pop them back later git stash (...later...) git stash pop (git stash pop can result in merge conflicts if you aren't in the same state your were when you stashed it. If so you get the merge conflicts to resolve, and the stash remains on the stack too.) The third option is to erase your changes. You can do that from the command line with git checkout. git checkout -p will prompt you before reverting each change, so you can be sure you're not throwing away anything important.

I think (not sure) `g

@yehudamakarov
yehudamakarov / symlink.md
Created January 16, 2019 15:43
[CMD] cmd commands for windows
@yehudamakarov
yehudamakarov / my-connected-component.tsx
Last active May 3, 2019 01:59 — forked from aheitzmann/my-connected-component.tsx
[Typed Connected Components] A best practice pattern for defining and using typescript types for a redux-react connected component
import * as React from 'react'
import * as Redux from 'redux'
import { MyReduxState } from './my-root-reducer.ts'
export interface OwnProps {
propFromParent: number
}
interface StateProps {
@yehudamakarov
yehudamakarov / BL.cs
Last active May 3, 2019 02:16
[JWT in .Net Core] basic JWT implementation with roles
public class AuthenticationBL : IAuthenticationBL
{
private readonly IAuthenticationRepository _authenticationRepository;
private readonly IConfiguration _configuration;
public AuthenticationBL(IAuthenticationRepository authenticationRepository, IConfiguration configuration)
{
_authenticationRepository = authenticationRepository;
_configuration = configuration;
@yehudamakarov
yehudamakarov / System Design.md
Created May 14, 2019 01:07 — forked from vasanthk/System Design.md
System Design Cheatsheet

System Design Cheatsheet

Picking the right architecture = Picking the right battles + Managing trade-offs

Basic Steps

  1. Clarify and agree on the scope of the system
  • User cases (description of sequences of events that, taken together, lead to a system doing something useful)
    • Who is going to use it?
    • How are they going to use it?