Skip to content

Instantly share code, notes, and snippets.

View alejo8591's full-sized avatar
💭
I may be slow to respond.

Alejandro Romero alejo8591

💭
I may be slow to respond.
  • Bogotá-Colombia
  • 21:53 (UTC -05:00)
View GitHub Profile
@alejo8591
alejo8591 / file_collector.py
Created August 31, 2021 02:10 — forked from bkaankuguoglu/file_collector.py
File Collector - Collects image files from the server via SOAP requests.
#========================================================================#
# file_collector.py #
#========================================================================#
#========================================================================#
# usage: file_collector.py [-h] [-f FILE] [-o OUTPUT_FOLDER] #
#========================================================================#
# optional arguments:
# -h, --help show this help message and exit
# -f FILE, --file FILE the xlsx file that contains all the files to be
# collected
@alejo8591
alejo8591 / celery.sh
Created February 22, 2018 16:27 — forked from amatellanes/celery.sh
Celery handy commands
/* Useful celery config.
app = Celery('tasks',
broker='redis://localhost:6379',
backend='redis://localhost:6379')
app.conf.update(
CELERY_TASK_RESULT_EXPIRES=3600,
CELERY_QUEUES=(
Queue('default', routing_key='tasks.#'),
@alejo8591
alejo8591 / onesignal-node.js
Created October 17, 2017 04:41 — forked from mulhoon/onesignal-node.js
Send a push notification in node with OneSignal
var request = require('request');
var sendMessage = function(device, message){
var restKey = '****';
var appID = '****';
request(
{
method:'POST',
uri:'https://onesignal.com/api/v1/notifications',
headers: {
@alejo8591
alejo8591 / scrape.py
Created October 10, 2017 15:01 — forked from miguelmota/scrape.py
Python Selenium get cookie value
import time
from selenium import webdriver
driver = webdriver.Chrome('./chromedriver')
driver.get('https://ui.lkqd.com/login')
assert 'LKQD' in driver.title
time.sleep(2)
username_field = driver.find_element_by_name('username')
username_field.send_keys('myusername')
@alejo8591
alejo8591 / ubuntu_py3.md
Created August 22, 2017 20:56 — forked from softwaredoug/ubuntu_py3.md
Ubuntu 14.04 Python 3.4.2 Setup using pyenv and pyvenv

What I did to get Python 3.4.2 on Ubuntu 14.04. The stock version of Python 3 on Ubuntu is 3.4.0. Which is missing some of the best parts! (asyncio, etc). Luckily I discovered pyenv which solved my problem.

Install pyenv

Pyenv (not to be confused with pyvenv) is the Python equivelant of rbenv. It lets you configure which Python environment/version is available per directory, user, or other session variables.

I followed the instructions here to install pyenv in my home directory. Verbatem, those instructions are:

sudo apt-get install git python-pip make build-essential libssl-dev zlib1g-dev libbz2-dev libreadline-dev libsqlite3-dev
@alejo8591
alejo8591 / vim.md
Last active August 10, 2017 18:59 — forked from vallettea/vim.md
Configure vim on mac

Install pathogen and use a proper directory structure

cd
mkdir -p .vim/{autoload,colors,syntax,plugin,spell,config}
mv .vimrc .vim/vimrc
ln -s .vim/vimrc .vimrc
cd ~/.vim
git clone https://github.com/tpope/vim-pathogen.git pathogen
cd autoload
@alejo8591
alejo8591 / forever-initd-example.sh
Created August 10, 2017 00:49 — forked from jinze/forever-initd-example.sh
forever init.d example
#!/bin/bash
#
# initd-example Node init.d
#
# chkconfig: 345 80 20
# description: Node init.d example
# processname: node
# pidfile: /var/run/initd-example.pid
# logfile: /var/log/initd-example.log
#
<html>
<head>
<title>Google Maps Multiple Markers</title>
<script src="http://maps.google.com/maps/api/js?sensor=false" type="text/javascript"></script>
</head>
<body>
<div id="map" style="height: 400px; width: 500px;">
</div>
<script type="text/javascript">
import matplotlib.pyplot as plt
import numpy as np
import tensorflow as tf
import pandas as pd
import csv
num_clusters = 4
num_steps = 100
num_vectors = 1000
SELECT id, nombre, (6371 * ACOS(
SIN(RADIANS(lat)) * SIN(RADIANS(4.6665578))
+ COS(RADIANS(lng - -74.0524521)) * COS(RADIANS(lat))
* COS(RADIANS(4.6665578))
)
) AS distance
FROM direcciones
HAVING distance < 1 /* 1 KM a la redonda */
ORDER BY distance ASC