Skip to content

Instantly share code, notes, and snippets.

const AWS = require('aws-sdk')
AWS.config.update({ region: process.env.AWS_REGION })
const s3 = new AWS.S3()
const uploadBucket = 'test-bucket-357' // Replace this value with your bucket name!
const URL_EXPIRATION_SECONDS = 30000 // Specify how long the pre-signed URL will be valid for
// Main Lambda entry point
exports.handler = async (event) => {
return await getUploadURL(event)
}
@cronosnull
cronosnull / airflowPostgresqlInstall.sh
Last active April 27, 2024 11:25
Install Airflow on a new Ubuntu server 18.04
#!/bin/bash
USUARIO_SO="$(whoami)"
ANACONDA_URL="https://repo.anaconda.com/archive/Anaconda3-5.2.0-Linux-x86_64.sh"
_DB_PASSWORD="la contraseña"
_IP=$(hostname -I | cut -d' ' -f1)
while getopts "a:p:h" opt; do
case $opt in
a) ANACONDA_URL="$OPTARG";;
p) _DB_PASSWORD="$OPTARG";;
h) cat <<EOF
@wojteklu
wojteklu / clean_code.md
Last active April 27, 2024 11:23
Summary of 'Clean code' by Robert C. Martin

Code is clean if it can be understood easily – by everyone on the team. Clean code can be read and enhanced by a developer other than its original author. With understandability comes readability, changeability, extensibility and maintainability.


General rules

  1. Follow standard conventions.
  2. Keep it simple stupid. Simpler is always better. Reduce complexity as much as possible.
  3. Boy scout rule. Leave the campground cleaner than you found it.
  4. Always find root cause. Always look for the root cause of a problem.

Design rules

System process daemons that are system-wide provided by mac os x are described by launchd preference files that can be showed with the command:
$ sudo ls -all /System/Library/LaunchDaemons/
Third party process daemons that are system-wide provided by the administrator are described by preference files that can be showed with the command:
$ sudo ls -all /Library/LaunchDaemons/
Launch Agents that are per-user provided by mac os x usually loaded when the user logs in. Those provided by the system can be found with:
$ sudo ls -all /System/Library/LaunchAgents/
Launch Agents that are per-user provided by the administrator and usually loaded when the user logs in. Those provided by the system can be found with:
@masklinn
masklinn / cheatsheet.md
Last active April 27, 2024 11:21
launchctl/launchd cheat sheet

I've never had great understanding of launchctl but the deprecation of the old commands with launchctl 2 (10.10) has been terrible as all resources only cover the old commands, and documentation for Apple utilities is generally disgracefully bad, with launchctl not dissembling.

Mad props to https://babodee.wordpress.com/2016/04/09/launchctl-2-0-syntax/ which contains most details

domains

Internally, launchd has several domains, but launchctl 1 would only ask for service names,

/*=============================================================================
Copyright (C) 2018 yumetodo <yume-wikijp@live.jp>
Distributed under the Boost Software License, Version 1.0.
(See https://www.boost.org/LICENSE_1_0.txt)
=============================================================================*/
//ref: http://dxlib.o.oo7.jp/cgi/patiobbs/patio.cgi?mode=view&no=4371
#include <string>
#if defined(__clang__)
# if !__has_feature(cxx_constexpr)
@jetfir3
jetfir3 / tmpdevmodify.sh
Last active April 27, 2024 11:17
Temporarily enable developer mode for the Spotify desktop client on Linux and macOS.
#!/usr/bin/env bash
# Temporarily enable developer mode for the Spotify desktop client on Linux and macOS.
showHelp () {
echo -e \
"Usage: ./tmpdevmodify.sh [option]\n
Options:
-c, --clearcache Clear Spotify app cache
-d, --debug Add Debug Tools to user dropdown menu
@PurpleVibe32
PurpleVibe32 / vmwk17key.txt
Last active April 27, 2024 11:15
Free VMware Workstation Pro 17 full license keys
Install VMWare Workstation PRO 17 (Read it right. PRO!)
Also, these keys might also work with VMWare Fusion 13 PRO. Just tested it.
Sub to me on youtube pls - PurpleVibe32
if you want more keys - call my bot on telegram. @purector_bot (THE BOT WONT REPLY ANYMORE) - Or: https://cdn.discordapp.com/attachments/1040615179894935645/1074016373228978277/keys.zip - the password in the zip is 102me.
---
This gist can get off at any time.
PLEASE, DONT COPY THIS. IF YOU FORK IT, DONT EDIT IT.
*If you have a problem comment and people will try to help you!
*No virus
@prof3ssorSt3v3
prof3ssorSt3v3 / api.css
Created February 7, 2021 23:33
Form Validation Part II - the JS code and working with the Constraint Validation API
* {
padding: 0;
margin: 0;
box-sizing: border-box;
}
html {
font-size: 16px;
font-weight: 300;
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen,
Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;