Skip to content

Instantly share code, notes, and snippets.

View Petka17's full-sized avatar
🏠
Working from home

Peter Petka17

🏠
Working from home
View GitHub Profile
@Petka17
Petka17 / http-get-file-and-save-it-to-S3.ts
Last active October 30, 2021 09:27
Useful TS snippets
const s3 = new AWS.S3({ region: 'eu-west-1' })
const response: AxiosResponse<ReadableStream> = await axios({
url: 'https://some-url.com/file.pdf',
method: 'GET',
responseType: 'stream',
})
await s3
.upload({

Frontend Masters: AWS for Frontend Engineers

You should have the following completed on your computer before the workshop:

  • Install the AWS CLI.
  • Have Node.js installed on your system. (Recommended: Use nvm.)
    • Install yarn with brew install yarn.
  • Create an AWS account. (This will require a valid credit card.)
  • Create a Travis CI account. (This should be as simple as logging in via GitHub).
set nocompatible
filetype plugin indent on " Load plugins according to detected file
syntax on " Enable syntax highlighting.
set nobackup "no backup files
set nowritebackup "only in case you don't want a backup file while editing
set noswapfile "no swap files
set clipboard=unnamed " System clipboard
import React from "react";
import { compose, withStateHandlers, withProps, withHandlers } from "recompose";
import { connect } from "react-redux";
import styled from "styled-components";
import * as R from "ramda";
import Flex, { FlexItem } from "styled-flex-component";
import { Form, FormItem, TextField, Checkbox, Button } from "reactackle";
# Set default terminal
set -g default-terminal "screen-256color"
# Disable mouse
set -g mouse off
# Set new prefix hotkey
set -g prefix C-a
# Unbind default prefix hotkey
alias dps='docker ps' # show running containers
alias dpsa='docker ps -a' # show all containers
alias dpsl='docker ps -l' # show last container
alias dpss='docker ps -as' # show all containers list with size
alias drm='docker rm -v' # remove container
alias drma='docker rm -v $(docker ps -aq)' # remove all containeres
alias da='docker attach' # attach
alias dr='docker run -it' # run container with interactive terminal
alias drr='docker run -it --rm' # run container with interactive terminal and remove afterwords
alias ll='ls -lhaFG' # List all files colorized in long format
alias ld='ls -l | grep "^d"' # List only directories
alias cp='cp -ivr' # Preferred 'cp' implementation
alias mv='mv -iv' # Preferred 'mv' implementation
alias rm='rm -ivR' # Preferred 'mv' implementation
alias mkdir='mkdir -pv' # Preferred 'mkdir' implementation
alias less='less -FSRXc' # Preferred 'less' implementation
alias cd..='cd ../' # Go back 1 directory level (for fast typers)
alias ..='cd ../' # Go back 1 directory level
alias ...='cd ../../' # Go back 2 directory levels
const http = require('http');
const fs = require('fs');
http.request({
host: 'siebel-agent28923.cloudapp.net',
// path: '/SmartConfigurator/api/configurations/diff/object/env-03:null/env-03:119',
path: '/SmartConfigurator/api/configurations/diff/objectNames/env-03:1/env-03:204',
port: '8080',
headers: {
'Authorization': 'Basic YWRtaW46YWRtaW4='
from unittest import TestCase
import time
import os
from testfixtures import OutputCapture
from shared.executor import Executor
class ExecutorTestCase(TestCase):
import os
import sys
import subprocess
import psutil
import signal
from threading import Thread
from multiprocessing import Process, Pipe
from Queue import Queue