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
for i in *.mov; do ffmpeg -i "$i" -vcodec libx264 -crf 24 "${i%.*}.mp4"; done |
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
/* eslint-disable no-bitwise, no-param-reassign, operator-assignment */ | |
// Mulberry32 - 32-bit random seed generator | |
// Source: https://github.com/bryc/code/blob/master/jshash/PRNGs.md#mulberry32 | |
/** | |
* Function is used to get the same random value every time to ensure | |
* data is the same in unit tests and screenshot tests for storybook | |
* @param seed | |
* @returns random number based on input seed |
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 { FrontEndDeveloper } from "./FrontEndDeveloper"; | |
import { StackOverflow } from "./StackOverflow"; | |
describe("FrontEndDeveloper tests", () => { | |
it("should still drink coffee", () => { | |
const webDeveloper = new FrontEndDeveloper(); | |
expect(webDeveloper.drinkCoffee()).toContain("coffee ☕"); | |
}); | |
it("should pretend to code", () => { |
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 { Developer } from "./Developer"; | |
import { StackOverflow } from "./StackOverflow"; | |
export class FrontEndDeveloper extends Developer { | |
public code(): string { | |
return StackOverflow.search("How to write unit tests"); | |
} | |
} |
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
/** Front-end developer secret trick ) | |
1) Right click on URL bar in Chrome | |
2) Open "Manage search engines..." and "Add" new | |
3) Fill in data: | |
Search engine: StackOverflow | |
Keyword: SO | |
URL with %s in place of query: | |
http://www.google.com/search?sourceid=chrome&ie=UTF-8&q=%s site:stackoverflow.com | |
4) Type SO and press Tab to search | |
*/ |
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
export class Developer { | |
public drinkCoffee(): string { | |
return "Drinking a cup of coffee ☕"; | |
} | |
} |
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 { Developer } from "./Developer"; | |
// name | |
test("should drink coffee", () => { | |
// setup | |
const developer = new Developer(); | |
// action | |
const result = developer.drinkCoffee(); | |
// expectation | |
expect(result).toContain("coffee ☕"); | |
}); |
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 { BalanceActionType, AddAction, WithdrawAction } from "./types" | |
export const add = (amount: number): AddAction => ({ | |
type: BalanceActionType.ADD, | |
payload: amount, | |
}) | |
export const withdraw = (amount: number): WithdrawAction => ({ | |
type: BalanceActionType.WITHDRAW, | |
payload: amount, |
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 { makeAutoObservable } from "mobx" | |
export class BalanceState { | |
balance = 1000 | |
constructor() { | |
makeAutoObservable(this) | |
} | |
add(value: number) { |
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
{ | |
"New Test React FC": { | |
"prefix": "ntfc", | |
"body": [ | |
"import React from 'react';", | |
"import { render } from '@testing-library/react';", | |
"import ${1} from './${1}';", | |
"", | |
"it ('${1} renders without crashing', () => {", | |
"\trender(", |
NewerOlder