Skip to content

Instantly share code, notes, and snippets.

View allanbatista's full-sized avatar

Allan Batista allanbatista

View GitHub Profile
@VictorNas
VictorNas / find_epsilon.py
Created April 29, 2020 17:45
Epsilon DBSCAN
def find_epsilon(matrix, min_samples):
"""
Automatically find epsilon hyperparameter necessary to run DBSCAN.
Args:
matrix (numpy array): Matrix embbeding. Each row represents a product title in form of a vector.
min_samples(int): Should be the same value of the min_samples hyperparameter used in DBSCAN.
Returns:
return eps(float): Value of episilon hyperparameter.
"""
@streslab
streslab / Headless_Ethereum_Ubuntu_16.04.md
Last active April 4, 2022 23:45
Headless NVIDIA overclock setup under Ubuntu Server 16.04 for ethereum mining

Headless Ethereum Miner Setup - NVIDIA

Reed Slaby, March 2018

Having grown tired of wasting a perfectly good monitor on my ethereum mining rig, I finally decided to replace the Ubuntu Desktop 16.04 installation with Ubuntu Server 16.04. Many of the gtutorials available at the time of this writing range from unecessarily complicated to flat-out wrong. This guide is intended to address many of those shortfalls.

Prerequisites

To complete this guide, you should already have:

  • Basic knowledge of Linux
  • An Ethereum wallet
@brenopolanski
brenopolanski / export-svg-inkscape.md
Created December 26, 2017 13:29
Exporting an object as svg from inkscape
  1. Select the object(s) to export
  2. Open the document properties window (Ctrl+Shift+D)
  3. Select "Resize page to drawing or selection"
  4. File > Save As Copy...
  5. Select Optimized SVG as the format if you want to use it on the web
@gleicon
gleicon / list_objects_google_storage_boto3.py
Last active October 11, 2023 14:27
How to use boto3 with google cloud storage and python to emulate s3 access.
from boto3.session import Session
from botocore.client import Config
from botocore.handlers import set_list_objects_encoding_type_url
import boto3
ACCESS_KEY = "xx"
SECRET_KEY = "yy"
boto3.set_stream_logger('')
@joelthchao
joelthchao / demo.py
Last active August 31, 2021 18:02
Keras uses TensorBoard Callback with train_on_batch
import numpy as np
import tensorflow as tf
from keras.callbacks import TensorBoard
from keras.layers import Input, Dense
from keras.models import Model
def write_log(callback, names, logs, batch_no):
for name, value in zip(names, logs):
summary = tf.Summary()
@ryuheechul
ryuheechul / 0-papercliper-fog-gcs.md
Created May 7, 2017 01:29
Paperclip + fog + Google Cloud Storage

An example code to use GCS instead of S3

@metaskills
metaskills / command.sh
Last active November 4, 2022 09:44
Ubuntu 16.04 Install Latest FreeTDS
$ sudo apt-get install wget
$ sudo apt-get install build-essential
$ sudo apt-get install libc6-dev
$ wget ftp://ftp.freetds.org/pub/freetds/stable/freetds-1.00.27.tar.gz
$ tar -xzf freetds-1.00.27.tar.gz
$ cd freetds-1.00.27
$ ./configure --prefix=/usr/local --with-tdsver=7.3
$ make
$ make install
@benileo
benileo / mongod.service
Last active March 1, 2021 04:57
Systemd Service Script for Mongod On Ubuntu 15.04, 15.10, 16.04 Xenial
[Unit]
Description=High-performance, schema-free document-oriented database
Documentation=man:mongod(1)
After=network.target
[Service]
Type=forking
User=mongodb
Group=mongodb
@julionc
julionc / 00.howto_install_phantomjs.md
Last active July 8, 2024 21:44
How to install PhantomJS on Debian/Ubuntu

How to install PhantomJS on Ubuntu

Version: 1.9.8

Platform: x86_64

First, install or update to the latest system software.

sudo apt-get update
sudo apt-get install build-essential chrpath libssl-dev libxft-dev
@mateusg
mateusg / active_admin.pt-BR.yml
Created November 7, 2013 22:27
pt-BR translations for Active Admin
pt-BR:
active_admin:
dashboard: "Painel Administrativo"
dashboard_welcome:
welcome: "Bem vindo ao Active Admin. Esta é a página de painéis padrão."
call_to_action: "Para adicionar seções ao painel, verifique 'app/admin/dashboard.rb'"
view: "Visualizar"
edit: "Editar"
delete: "Remover"
delete_confirmation: "Você tem certeza que deseja remover este item?"