Skip to content

Instantly share code, notes, and snippets.

View codeAshu's full-sized avatar
👋

Ashutosh Trivedi codeAshu

👋
View GitHub Profile
import tweetClassifier as tc
#example to check a sentence
tc.isWant("my car is broken")
#example to check a file having tweets
tc.wantFromFile('tweets_train.txt')
sudo docker run -i -t -v <local path>/GoogleNews-vectors-negative300.bin:/app/GoogleNews-vectors-negative300.bin codeashu/twt-cats
@codeAshu
codeAshu / gist:6884217
Created October 8, 2013 12:53
Anusha Start working on following functions. In every function we are taking trackInput as string containing trackno separated by comma. First write a utility function to convert them to an integer array then calculate the seek time. or any other way you are comfertable with. return seekTime of each algorithm.
//utility method to return an array from comma separated string
//it will convert all trackInput into arrays.
private int seekLOOK(String trackInput, int startPoint) {
// TODO Auto-generated method stub
return 0;
}
@codeAshu
codeAshu / caffe_install.sh
Created April 8, 2017 08:27
Commands to run to install caffe
#!/usr/bin/env bash
#dependencies
sudo apt-get install -y build-essential libgoogle-glog-dev libgflags-dev libeigen3-dev\
libopencv-dev libcppnetlib-dev libboost-dev libcurlpp-dev libcurl4-openssl-dev protobuf-compiler\
libopenblas-dev libhdf5-dev libprotobuf-dev\
libleveldb-dev libsnappy-dev liblmdb-dev libutfcpp-dev cmake
# few more
sudo apt-get install -y build-essential autoconf libtool pkg-config python-opengl python-imaging\
python-pyrex python-pyside.qtopengl idle-python2.7 qt4-dev-tools qt4-designer libqtgui4 libqtcore4\
import os
import redis
from rq import Worker, Queue, Connection
listen = ['default']
redis_url = os.getenv('REDISTOGO_URL', 'redis://localhost:6379')
conn = redis.from_url(redis_url)
@codeAshu
codeAshu / zifilink-setup.sh
Created July 6, 2017 07:49
Setup for zifiLink team
# if language is not english
if lang[:2] != 'en':
text = text.replace(' ', '%2520')
text = u"text:Noto%20Sans_20:" + text
res = CloudinaryImage(image_url).image(transformation=[
{"background": "black", "opacity": 80},
{"width": 400, "height": 300, "crop": "scale"},
{"overlay": text, "color": "yellow", "crop": "fit", "width": 300, "height": 250},
from moviepy.editor import *
from moviepy.video.tools.subtitles import SubtitlesClip
audio_path = "/path/to/audio/05022357-a41f-11e7-b42c-f45c89a1211f.mp4"
srt_path = "path/to/srt/06665ef8-a41f-11e7-b3eb-f45c89a1211f.srt"
image_path = '/path/to/image/DSC_0265.JPG'
#generate srt
generator = lambda txt: TextClip(txt, font='Arial', fontsize=16, color='white')
subtitles = SubtitlesClip(srt_path, generator)
@codeAshu
codeAshu / feeds_unique.txt
Created May 12, 2018 11:15 — forked from eteubert/feeds_unique.txt
List of Podcast RSS Feeds, extracted via iTunes API
This file has been truncated, but you can view the full file.
<http://sailortalk.podOmatic.com/rss2.xml>
HTTP://www.knient.com/CAL/CAL-Podcast/CAL-Podcast.xml
Http://feeds.feedburner.com/fridgeandhbomb
Http://feeds.feedburner.com/wfodicks
Http://ravenc-taouf.podomatic.com/rss2.xml
Http://www.calvaryonline.org/podcasts/podcast.xml
Http://www.changkhui.com/XML/teemateepai.xml
httP://dtfreunde.podcaster.de/Deutsches_Theater.rss
http://-myantioch.sermon.tv/rss/main
http://004.podOmatic.com/rss2.xml
@codeAshu
codeAshu / plot_clusters.py
Created June 27, 2018 05:11
cluster plot
import pylab as pl
from itertools import cycle
def plot_2D(data, target, target_names):
colors = cycle('rgbcmykw')
target_ids = range(len(target_names))
pl.figure()
for i, c, label in zip(target_ids, colors, target_names):
pl.scatter(data[target == i, 0], data[target == i, 1],
c=c, label=label)
pl.legend()