Skip to content

Instantly share code, notes, and snippets.

View javier's full-sized avatar

javier ramírez javier

View GitHub Profile
@john-guerra
john-guerra / README.md
Last active November 3, 2023 11:37
Mongo Airbnb Sample Database

The mongo airbnb sample database

Import it into your local mongo with:

mongoimport -h localhost:27017 --db sample_airbnb --collection listingsAndReviews --file listingsAndReviews.json
@phortuin
phortuin / postgres.md
Last active April 30, 2024 02:26
Set up postgres + database on MacOS (M1)

Based on this blogpost.

Install with Homebrew:

$ brew install postgresql@14

(The version number 14 needs to be explicitly stated. The @ mark designates a version number is specified. If you need an older version of postgres, use postgresql@13, for example.)

@RoaldSchuring
RoaldSchuring / sagemaker_functions.py
Created July 9, 2019 02:08
extracting_info_from_vectorstxt
from sklearn.preprocessing import normalize
# open the vectors.txt file containing all the trained word embeddings, extracting the descriptors & embeddings
num_points = len(open('vectors.txt','r').read().split('\n'))
first_line = True
index_to_word = []
with open("vectors.txt","r") as f:
for line_num, line in enumerate(f):
if first_line:
@jakechen
jakechen / opencv-python_rekognition.py
Created September 20, 2017 15:38
Using opencv to parse frames for Amazon Rekognition to analyze. This example uses Rekognition's celebrity recognition feature as an example.
# With help from https://aws.amazon.com/blogs/ai/build-your-own-face-recognition-service-using-amazon-rekognition/
frame_skip = 100 # analyze every 100 frames to cut down on Rekognition API calls
import boto3
import cv2
from PIL import Image
import io
rekog = boto3.client('rekognition')
@sscotth
sscotth / keystroke the clipboard extended.workflow
Last active April 17, 2024 12:21
Paste as keystrokes (macOS)
# Why?
# To paste text into windows that normally don't allow it or have access to the clipboard.
# Examples: Virtual machines that do not yet have tools installed, websites that hijack paste
#
# Extended vs Simple?
# * Includes an initial delay to allow you to change active windows
# * Adds small delay between keypresses for slower responding windows like SSH sessions
# * Better handling of numbers
# * VMWare bug fix
#
@pahaz
pahaz / google_spreadsheets_create_update_example.py
Created July 15, 2016 13:31
Python Google spreadsheets v4 API example. Google spreadsheet access management example. Use google drive v3 API for access management
"""Google spreadsheet related.
Packages required: oauth2client, google-api-python-client
* https://gist.github.com/miohtama/f988a5a83a301dd27469
"""
from oauth2client.service_account import ServiceAccountCredentials
from apiclient import discovery
def get_credentials(scopes: list) -> ServiceAccountCredentials:
@Azrael808
Azrael808 / phpmyadmin.config
Created March 2, 2016 20:03
Install and Configure PHPMyAdmin on Elastic Beanstalk
container_commands:
01_install_pma:
test: test -n "$PMA_VER" && test ! -f /tmp/phpmyadmin.tar.gz
command: |
cd /tmp
wget https://files.phpmyadmin.net/phpMyAdmin/${PMA_VER}/phpMyAdmin-${PMA_VER}-all-languages.tar.gz
wget https://files.phpmyadmin.net/phpMyAdmin/${PMA_VER}/phpMyAdmin-${PMA_VER}-all-languages.tar.gz.sha1
cd /tmp && sha1sum --check phpMyAdmin-${PMA_VER}-all-languages.tar.gz.sha1
if [[ $? == 0 ]]
then
@protrolium
protrolium / ffmpeg.md
Last active May 15, 2024 18:27
ffmpeg guide

ffmpeg

Converting Audio into Different Formats / Sample Rates

Minimal example: transcode from MP3 to WMA:
ffmpeg -i input.mp3 output.wma

You can get the list of supported formats with:
ffmpeg -formats

You can get the list of installed codecs with:

@gbuesing
gbuesing / ml-ruby.md
Last active February 28, 2024 15:13
Resources for Machine Learning in Ruby

UPDATE a fork of this gist has been used as a starting point for a community-maintained "awesome" list: machine-learning-with-ruby Please look here for the most up-to-date info!

Resources for Machine Learning in Ruby

Gems