Skip to content

Instantly share code, notes, and snippets.

View rtorcato's full-sized avatar
💭
I build next generation apps (Javascript, React, React Native, Node & GraphQL)

Richard Torcato rtorcato

💭
I build next generation apps (Javascript, React, React Native, Node & GraphQL)
View GitHub Profile

macOS Keyboard Shortcuts You Should Know

These keyboard shortcuts will work in most, if not all text editing places in macOS. (Form input, text editors, web browsers etc.) These keyboard shortcuts will also work on Windows (replace CMD with CTRL).

Jump Over Words

ALT + Left/Right

Go to end of line

@rtorcato
rtorcato / terminal-commands.md
Created September 14, 2022 15:27 — forked from bradtraversy/terminal-commands.md
Common Terminal Commands

Common Terminal Commands

Key Commands & Navigation

Before we look at some common commands, I just want to note a few keyboard commands that are very helpful:

  • Up Arrow: Will show your last command
  • Down Arrow: Will show your next command
  • Tab: Will auto-complete your command
  • Ctrl + L: Will clear the screen
@rtorcato
rtorcato / one.html
Created September 2, 2020 13:10 — forked from prof3ssorSt3v3/one.html
Using window.open
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Page Three</title>
</head>
<body>
<h1 id="head">This is page three</h1>
</body>
@rtorcato
rtorcato / immer_sample.js
Created June 5, 2020 14:19
Immer sample
import produce from 'immer';
const like = item => ({
type: like.type,
payload: item
});
like.type = 'user/like';
const initialState = {
name: 'Anonymous',
@rtorcato
rtorcato / await_all.js
Created June 5, 2020 14:17
all all with promise
// bad time = Date.now()
/*
const foo = await fetchFoo()
const bar = await fetchBar()
const baz = await fetchBaz()
*/
// Good
const time = Date.now()
const [foo, bar, baz] = await Promise.all([fetchFoo(), fetchBar(), fetchBaz()]);
@rtorcato
rtorcato / eslintrc.json
Last active March 5, 2020 16:57
eslintrc.json for React projects that use airbnb rules with eslint , prettier and typescript
{
"env": {
"browser": true,
"es6": true,
"jest": true,
"node": true
},
"extends": [
"airbnb",
"plugin:@typescript-eslint/recommended",
@rtorcato
rtorcato / base.css
Last active February 17, 2020 14:59
a simple default css for html pages
@import url('https://fonts.googleapis.com/css?family=Roboto&display=swap');
:root {
--font-size: 2rem;
--font: Arial, Helvetica, sans-serif;
--font-styled: Roboto;
--main-bg-color: lightblue;
--clr-primary: lightblue;
--clr-light: #f4f4f4;
--clr-dark: #333;
@rtorcato
rtorcato / querystring.js
Created May 3, 2019 18:56
Get Query String Parameters
Get Query String Parameters
// Assuming "?post=1234&action=edit"
var urlParams = new URLSearchParams(window.location.search);
console.log(urlParams.has('post')); // true
console.log(urlParams.get('action')); // "edit"
console.log(urlParams.getAll('action')); // ["edit"]
console.log(urlParams.toString()); // "?post=1234&action=edit"
import * as Sentry from "@sentry/node";
import imagemin from "imagemin";
import mozjpeg from "imagemin-mozjpeg";
import sharp from "sharp";
import isJpg from "is-jpg";
import * as aws from "aws-sdk";
import { Upload } from "../../types/graphqlUtils";
import { generateFilename } from "./generateFilename";
export const s3 = new aws.S3({
@rtorcato
rtorcato / docker-compose.yml
Last active March 26, 2019 18:36
Getting Microsoft Sql Server on Docker using docker-compose and mssql-server-linux
#A strong system administrator (SA) password: At least 8 characters including uppercase, lowercase letters, base-10 digits and/or non-alphanumeric symbols.
version: "3.2"
services:
mssql:
container_name: myMSSQL
image: microsoft/mssql-server-linux:2017-latest
volumes:
- ./.db:/var/opt/mssql/
- /var/opt/mssql/data