Skip to content

Instantly share code, notes, and snippets.

@dhiraka
dhiraka / deploy-static-site-heroku.md
Created November 22, 2017 02:25 — forked from wh1tney/deploy-static-site-heroku.md
How to deploy a static website to Heroku

Gist

This is a quick tutorial explaining how to get a static website hosted on Heroku.

Why do this?

Heroku hosts apps on the internet, not static websites. To get it to run your static portfolio, personal blog, etc., you need to trick Heroku into thinking your website is a PHP app. This 6-step tutorial will teach you how.

Basic Assumptions

@dhiraka
dhiraka / SentimentAnalysis.rb
Last active August 29, 2015 14:22
Sentiment Analysis for a bunch of texts to be done asynchronously
require 'httparty'
module SentimentAnalysis
texts = [
"I am a pathetic person",
"Today is going to be a good day",
"I wish you were dead"
]
def insertionSort(array)
(1..array.length-1).each do |i|
temp=array[i]
j=i-1
while(j>=0 && array[j]>temp)
array[j+1]=array[j]
j -= 1
end
array[j+1]=temp
end
def merge(array1,array2)
index1=0
index2=0
x = array1.length + array2.length
mergedArray = []
while(mergedArray.length < x)
if(array1[index1].nil?)
mergedArray.push(array2[index2])
index2 += 1
elsif (array2[index2].nil?)