Skip to content

Instantly share code, notes, and snippets.

🐢
workin'

Cecy Correa cecyc

🐢
workin'
Block or report user

Report or block cecyc

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@cecyc
cecyc / markdown_embed_video_workaround.md
Last active Sep 11, 2019
Markdown video embed workaround
View markdown_embed_video_workaround.md

Code:

[![Image Alt](http://placekitten.com/200/300)](https://www.youtube.com/watch?v=pvEuYcM0j6M)

Result

Image Alt

@cecyc
cecyc / eventbrite_webhooks.py
Last active Aug 20, 2019
Example using Eventbrite API. Checks whether users have accepted a specific question.
View eventbrite_webhooks.py
from eventbrite import Eventbrite
API_KEY = ''
ORDER_ID = ''
def hit_eventbrite_api():
ev = Eventbrite(API_KEY)
View oregon-regex.md

A regex for US States

Example:

/(OR)|(or)$|([Oo]regon)$/gm

Matches: Eugene, OR eugene, or Somewhere, oregon

View hide-scrollbar.md
.container {
    -ms-overflow-style: none;  // IE 10+
    overflow: -moz-scrollbars-none;  // Firefox
}
.container::-webkit-scrollbar { 
    display: none;  // Safari and Chrome
}
@cecyc
cecyc / docker_and_kubernetes_cheatsheet.md
Created Aug 29, 2018
A quick reference doc for Docker and Kubernetes for those starting out
View docker_and_kubernetes_cheatsheet.md

Docker and Kubernetes cheatsheet

Docker

Basics

Basic commands:

  • docker ps list all currently running containers
  • docker-compose build build a series of containers based on a docker-compose file
@cecyc
cecyc / uploading_to_s3.py
Last active Aug 20, 2019
Sample script for batch processing data and uploading output to S3. This snippet processes batch data from the WHOIS Bulk API based on a CSV list of IPs to search in WHOIS.
View uploading_to_s3.py
import argparse
import boto3
import json
import logging
import os
import pandas
from pandas import DataFrame, read_csv
import requests
import time
import random
@cecyc
cecyc / open-csv.py
Last active Aug 20, 2019
Open a CSV in Python
View open-csv.py
parser = argparse.ArgumentParser()
parser.add_argument("-c", "--csv", required=True, help="csv to parse ips from")
flags = vars(parser.parse_args())
csv_file = flags["csv"]
results = []
with open(csv_file, newline='') as f:
csvreader = csv.reader(f)
@cecyc
cecyc / docker-for-flask.md
Last active Jul 17, 2018
Dockerfile and docker-compose for a simple Flask app
View docker-for-flask.md

Dockerfile

FROM python:3.4
RUN apt-get update -y
RUN apt-get install -y python-pip build-essential
COPY ./path-to-app /app
WORKDIR /app
RUN pip install --no-cache-dir -r requirements.txt
ENV FLASK_APP=app.py
View ascii_bunny
| ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄|
| boop |
|          |
|__________|
(\_❀) ||
(•ㅅ•) ||
/   づ
@cecyc
cecyc / getUrl.js
Last active Jul 17, 2018
Simple script to request a video from YouTube API
View getUrl.js
// Request to YouTube
const API_KEY=""
const videoUrl = "https://www.youtube.com/watch?v="
let reqUrl = `https://www.googleapis.com/youtube/v3/search?key=API_KEY&part=snippet&q=${query}&maxResults=25`
//Get a random int to pick a random video from the results
const getRandomInt = () => {
let num = Math.random
//maxResults are 25 index 0, get a random number between 0 and 24
return Math.floor(num * 24)
You can’t perform that action at this time.