Skip to content

Instantly share code, notes, and snippets.

View cxrlospxndo's full-sized avatar

Carlos Pando Morales cxrlospxndo

View GitHub Profile
from gensim import models
sentence = models.doc2vec.LabeledSentence(
words=[u'so`bme', u'words', u'here'], tags=["SENT_0"])
sentence1 = models.doc2vec.LabeledSentence(
words=[u'here', u'we', u'go'], tags=["SENT_1"])
sentences = [sentence, sentence1]
model = models.Doc2Vec(alpha=.025, min_alpha=.025, min_count=1)
@cxrlospxndo
cxrlospxndo / gist:2b7e62ddb3ed995636d3c8e2dc35de32
Last active May 4, 2016 15:53
rename branch to something like current_branch_name + bar
> current branch foo
git branch -m $(git rev-parse --abbrev-ref HEAD)bar
> foo branch renamed to foobar
where:
git branch -m <new_name> # if we want to rename current branch to <new_name>
git branch -m <branch_name> <new_name> # renaming <branch_name> to <new_name>
git rev-parse --abbrev-ref HEAD # current branch name
$(...) # evals what is inside
@cxrlospxndo
cxrlospxndo / loading_image.py
Created September 8, 2015 07:03
classifying images
import os
import skimage
import matplotlib.pyplot as plt
import numpy as np
from skimage import io
from skimage import exposure
from skimage.filters import threshold_otsu
# image's path
current_dir = os.path.dirname(os.path.abspath(__file__))
@cxrlospxndo
cxrlospxndo / xpath.js
Created August 20, 2015 15:20
finding an element by xpath
var myPath = "/html/body/div[2]";
console.log(document.evaluate(myPath, document, null, XPathResult.FIRST_ORDERED_NODE_TYPE, null).singleNodeValue);
console.log($x(myPath)[0]);
// xpath selectors starts with 1
// using $x will return an array starting with 0
@cxrlospxndo
cxrlospxndo / firebase.html
Last active August 29, 2015 14:22
firebase example
<html>
<head>
<script src='https://cdn.firebase.com/js/client/2.2.1/firebase.js'></script>
<script src='https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js'></script>
</head>
<body>
<style type="text/css">
#star-six {
width: 0;
height: 0;
@cxrlospxndo
cxrlospxndo / led7_hdi.ino
Last active August 29, 2015 14:16
arduino + led7 + heart disease indicator
// variables globales
String thal = "DEFECTO"; // DEFECTO, NORMAL, REPARACION DETECTADA
float edad = 60;
int presion_sanguinea = 110;
bool angina_inducida = true;
bool azucar_en_sangre = true;
int max_ratio_cardiaco = 118;
int colesterol = 270;
void setup() {
Apartment::Database.switch('alamo')
require 'pp'
require 'open-uri'
class App
def call(env)
@env = env
path = env["PATH_INFO"].split("/")
path.shift if path[0] == ""
class DPrinter
def print
puts yield
end
end
class LaserPrinter
def print
puts yield
end
@cxrlospxndo
cxrlospxndo / pom.xml
Created November 29, 2013 00:08
mvn pom.xml
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>hestudio</groupId>
<artifactId>honorariosEstudio</artifactId>
<name>honorariosEstudio</name>
<version>0.9</version>
<build>
<sourceDirectory>src</sourceDirectory>