Skip to content

Instantly share code, notes, and snippets.

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

Rafael rapala61

🏠
Working from home
View GitHub Profile
@rapala61
rapala61 / curl.md
Created November 1, 2023 19:17 — forked from subfuzion/curl.md
curl POST examples

Common Options

-#, --progress-bar Make curl display a simple progress bar instead of the more informational standard meter.

-b, --cookie <name=data> Supply cookie with request. If no =, then specifies the cookie file to use (see -c).

-c, --cookie-jar <file name> File to save response cookies to.

@rapala61
rapala61 / comprehensive_header.py
Created July 22, 2020 23:06 — forked from NicolasBizzozzero/comprehensive_header.py
Python template of a comprehensive header, with shebang, docstring, GPLv3 license and all metadata.
#!/usr/bin/env python
""" Short description of this Python module.
Longer description of this module.
This program is free software: you can redistribute it and/or modify it under
the terms of the GNU General Public License as published by the Free Software
Foundation, either version 3 of the License, or (at your option) any later
version.
@rapala61
rapala61 / postgres_queries_and_commands.sql
Created February 4, 2020 04:11 — forked from rgreenjr/postgres_queries_and_commands.sql
Useful PostgreSQL Queries and Commands
-- show running queries (pre 9.2)
SELECT procpid, age(clock_timestamp(), query_start), usename, current_query
FROM pg_stat_activity
WHERE current_query != '<IDLE>' AND current_query NOT ILIKE '%pg_stat_activity%'
ORDER BY query_start desc;
-- show running queries (9.2)
SELECT pid, age(clock_timestamp(), query_start), usename, query
FROM pg_stat_activity
WHERE query != '<IDLE>' AND query NOT ILIKE '%pg_stat_activity%'
https://www.youtube.com/watch?v=et8xNAc2ic8
@rapala61
rapala61 / ds-messaging-test.md
Last active April 25, 2018 15:22 — forked from mshmsh5000/ds-messaging-test.md
DoSomething messaging engineer: Code test

Assignment

Create three components that interact:

  1. A web app that serves a form. The form should functionally and visually mimic our user registration form. The submit handler should send an event & the data payload to
  2. A queue that receives the event, where it can be retrieved by
  3. An event consumer, which emails the form data to a preset address that you and we can access (e.g., [email protected])

Details

@rapala61
rapala61 / example.cs
Created April 2, 2018 16:04 — forked from brandonmwest/example.cs
Generating base64-encoded Authorization headers in a variety of languages
httpClient.DefaultRequestHeaders.Authorization =
new AuthenticationHeaderValue(
"Basic",
Convert.ToBase64String(
System.Text.ASCIIEncoding.ASCII.GetBytes(
string.Format("{0}:{1}", username, password))));

Pull workflow

How to sync your development with upstream

  1. Checkout your master branch
  2. Pull from upstream into master && push from master into origin.
  3. checkout your branch
  4. Merge master into branch
  5. Push branch into origin

Finally, when you are ready to create a pull request

GitHub team organization

Pick a member of the team as the responsible party to manage the organization. For now I'll refer to him as the GitHub Lead.

Create an organization

  • Github Lead responsibility
  • The organization name has to be unique in github

Add team members as organization members

@rapala61
rapala61 / Oauth2.md
Created April 20, 2016 15:27 — forked from mziwisky/Oauth2.md
Oauth2 Explanation

OAUTH2

The Problem

I’m a web app that wants to allow other web apps access to my users’ information, but I want to ensure that the user says it’s ok.

The Solution

I can’t trust the other web apps, so I must interact with my users directly. I’ll let them know that the other app is trying to get their info, and ask whether they want to grant that permission. Oauth defines a way to initiate that permission verification from the other app’s site so that the user experience is smooth. If the user grants permission, I issue an AuthToken to the other app which it can use to make requests for that user's info.

Note on encryption

Oauth2 has nothing to do with encryption -- it relies upon SSL to keep things (like the client app’s shared_secret) secure.

Command Line Interface - (20m)

Introduction

You are going to build a few homes and move stuff around a bit using the Command Line.

Exercise

Navigate to your desktop and create a folder named cli_lab

Change directory to the newly created cli_lab. We are going to work from inside this folder.