Skip to content

Instantly share code, notes, and snippets.

View andrewsosa's full-sized avatar

Andrew Sosa andrewsosa

View GitHub Profile
// Import the necessary libraries
const request = require('request');
const async = require('async');
// Set the necessary credentials and tokens
const appId = 'YOUR_APP_ID';
const appSecret = 'YOUR_APP_SECRET';
const accessToken = 'YOUR_ACCESS_TOKEN';
// Set the base URL for the Reddit API
@andrewsosa
andrewsosa / github-friends-sample-data.json
Last active July 1, 2021 03:12
github-friends-sample-data
[
{
"popularity": 28287,
"avatar": "https://avatars0.githubusercontent.com/u/1299233?s=400&v=4",
"url": "https://github.com/toxtli",
"username": "toxtli",
"source": "andrewsosa"
},
{
"popularity": 21085,
@andrewsosa
andrewsosa / spire-of-stars.md
Last active July 25, 2020 22:57
How To: Spire of Stars

Start Phase

  • Everyone clears ads.
  • When the ball spawns, the closest person will call out and grab it, and everyone else will line up.
  • Everyone passes the ball down the line.
  • After everyone has held the ball, the last person throws it at the boss.

Space Phase #1 (Scout Phase)

  • If you receive the Superior Retainer buff, immediately call it out.
  • One Superior Retainer should declare they will go to space. They are the Alpha Retainer. The two others are Beta Retainers.
  • The Beta Retainers and non-retainers should appoach the platforms, but kill the gladiators before standing on the them. One person will not have a platform.
@andrewsosa
andrewsosa / dijkstra.py
Created January 4, 2020 16:33
Dijkstra Implementation
"""
Implementation is inspired by this article:
https://dev.to/mxl/dijkstras-algorithm-in-python-algorithms-for-beginners-dkc
Graph is from this video:
https://www.youtube.com/watch?v=gdmfOwyQlcI
"""
import math
@andrewsosa
andrewsosa / guidelines.md
Last active July 2, 2018 18:06
Recommended Git workflow for Open Source/Multi-Contributor Projects

Recommended Workflow

Good for Open Source/Multi-contributor projects

Table of contents:
  1. Overview
  2. Step Details
  3. Important Details/Warnings
Key terms
  • Upstream: The original, organization-based repo (e.g. fsu-acm/contest-suite).
PROMPT='%m %{$fg[green]%}%c%{$fg_bold[blue]%}$(git_prompt_info)%{$reset_color%} '
ZSH_THEME_GIT_PROMPT_PREFIX=" ("
ZSH_THEME_GIT_PROMPT_SUFFIX=")"
ZSH_THEME_GIT_PROMPT_DIRTY=" ✗"
ZSH_THEME_GIT_PROMPT_CLEAN=" ✔"
@andrewsosa
andrewsosa / proposal.py
Created November 10, 2017 17:20
[ApiMultiView Proposal] A view which tasks out work() calls to delegate ApiView classes
#
# hackfsu_com.views.generic.api_multi_view
#
class ApiMultiView(ApiView):
http_method_names = [] # This must be overridden for every multiview
http_delegates = {} # Dictionary of delegate ApiView objects, key is the method
def work(self, request: HttpRequest, req: dict, res: dict):
@andrewsosa
andrewsosa / passwd.py
Created October 18, 2017 14:11
[DigitalOcean Web Console Login] #tags: digitalocean
from pynput.keyboard import Key, Controller
import time
keyboard = Controller()
# # Press and release space
# keyboard.press(Key.space)
# keyboard.release(Key.space)
#
@andrewsosa
andrewsosa / server.log
Created September 8, 2017 04:27
Someone tried to break into my site
nginx.1 | 162.243.44.174 172.17.0.1 - - [07/Sep/2017:23:01:58 +0000] "HEAD / HTTP/1.0" 503 0 "-" "Mozilla/5.0 Jorgee"
nginx.1 | 162.243.44.174 172.17.0.1 - - [07/Sep/2017:23:14:56 +0000] "HEAD /mysql/admin/ HTTP/1.0" 503 0 "-" "Mozilla/5.0 Jorgee"
nginx.1 | 162.243.44.174 172.17.0.1 - - [07/Sep/2017:23:14:56 +0000] "HEAD /mysql/dbadmin/ HTTP/1.0" 503 0 "-" "Mozilla/5.0 Jorgee"
nginx.1 | 162.243.44.174 172.17.0.1 - - [07/Sep/2017:23:14:56 +0000] "HEAD /mysql/sqlmanager/ HTTP/1.0" 503 0 "-" "Mozilla/5.0 Jorgee"
nginx.1 | 162.243.44.174 172.17.0.1 - - [07/Sep/2017:23:14:56 +0000] "HEAD /mysql/mysqlmanager/ HTTP/1.0" 503 0 "-" "Mozilla/5.0 Jorgee"
nginx.1 | 162.243.44.174 172.17.0.1 - - [07/Sep/2017:23:14:56 +0000] "HEAD /phpmyadmin/ HTTP/1.0" 503 0 "-" "Mozilla/5.0 Jorgee"
nginx.1 | 162.243.44.174 172.17.0.1 - - [07/Sep/2017:23:14:56 +0000] "HEAD /phpMyadmin/ HTTP/1.0" 503 0 "-" "Mozilla/5.0 Jorgee"
nginx.1 | 162.243.44.174 172.17.0.1 - - [07/Sep/2017:23:14:57 +0000] "HEAD /phpMyAdmin/ HT
@andrewsosa
andrewsosa / .hyper.js
Created April 22, 2017 15:42
hyper.js config
module.exports = {
config: {
// default font size in pixels for all tabs
fontSize: 12,
// font family with optional fallbacks
fontFamily: 'Menlo, "DejaVu Sans Mono", Consolas, "Lucida Console", monospace',
// terminal cursor background color and opacity (hex, rgb, hsl, hsv, hwb or cmyk)
cursorColor: 'rgba(248,28,229,0.8)',