This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# credit to this person for a js implementation of the function, http://stackoverflow.com/users/3473058/user3473058 | |
def find_local_maxima(input_array) | |
goAsc = false # ascending move | |
goDesc = false # descending move | |
local_maxima = [] | |
index = 0 | |
while (index < (input_array.length - 1)) do |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'aws-sdk' | |
require 'unirest' | |
require 'pp' | |
STOCKTWITS_QUEUE_URL = 'PATH TO YOUR QUEUE GOES HERE...' # looks like https://sqs.REGION.amazonaws.com/######/name | |
STOCKTWITS_API_URL = 'https://api.stocktwits.com/api/2/messages/create.json?access_token=ACCESS_TOKEN_OF_STOCKTWITS_USER_TO_POST' | |
Aws.config.update({ | |
region: 'REGION', | |
credentials: Aws::Credentials.new('ACCESS KEY', 'SECRET') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'posix/spawn' | |
require 'pry' | |
require 'active_support/all' | |
years = (2010..2016).to_a | |
quarters = (1..4).to_a | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'nokogiri' | |
require 'pg' | |
require 'json' | |
require 'parallel' | |
require 'timeout' | |
def score( array ) | |
array.each_with_object(Hash.new(0)){|key,hash| hash[key] += 1} | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'open-uri' | |
require 'nokogiri' | |
require 'groupdate' | |
require 'gruff' | |
nok = Nokogiri(open("https://www.zidisha.org/reports/loans-funded")) | |
countries = nok.search("select[name='country']").search('option').map{|x|[x.children.text, x.attributes['value'].value.to_sym]}.reject{|x|x.first.blank?} | |
countries.each do |country, code| | |
begin |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'parallel' | |
require 'httparty' | |
require 'pry' | |
def fetch_reddit_page(reddit_link) | |
cookies = [ ] # get these from EditThisCookie chrome extension: Export -> Copy to clipboard (copies as a ruby-friendly array of hashes) | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
["#job", 6], ["$100,000.00", 6], ["$14,100", 6], ["$155,", 6], ["$18/hr", 6], ["$20/hr", 6], ["$27.00", 6], ["$28.50", 6], ["$37.00", 6], ["$42.75", 6], ["$43.00", 6], ["$44.00", 6], ["$66.00", 6], ["$70-$85k.\\n\\nrequired", 6], ["$95,000.00", 6], ["$95k", 6], [">>>", 6], ["(.net,", 6], ["(18+)", 6], ["(2+", 6], ["(3)", 6], ["(40", 6], ["(50%", 6], ["(8", 6], ["(anaheim)", 6], ["(android", 6], ["(any", 6], ["(auburn)", 6], ["(backend)", 6], ["(battery", 6], ["(bay", 6], ["(berlin,", 6], ["(bonus)", 6], ["(bronx)", 6], ["(btc)", 6], ["(burlington)", 6], ["(burnaby)", 6], ["(c#,", 6], ["(c++,", 6], ["(c,", 6], ["(crypto", 6], ["(csv)", 6], ["(cupertino)", 6], ["(custom", 6], ["(customer", 6], ["(dba)", 6], ["(desktop", 6], ["(devops)", 6], ["(dlp)", 6], ["(dmv)", 6], ["(ember", 6], ["(ex.", 6], ["(excel,", 6], ["(fi/co)", 6], ["(fresno,", 6], ["(full-stack)", 6], ["(gaithersburg)", 6], ["(greenwich", 6], ["(hardware", 6], ["(harlem", 6], ["(high", 6], ["(hp", 6], ["(http://academy.hubspot.com/certific |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def expand_keyword_list(keyword_list) | |
synonym_list = { | |
'rails': ['ror', 'ruby on rails', 'rails'], | |
'html': ['html5', 'html', 'html4'], | |
'css': ['css3', 'css', 'cascading style sheets', 'cascading stylesheets'], | |
'node': ['node', 'nodejs', 'node.js', 'node js'], | |
'javascript': ['javascript', 'java script', 'js'], | |
' unity ': [' unity ', 'unity3d', 'unity 3d'] | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import csv | |
import string | |
import re | |
programming_keywords = set([".net", ".net core", "3d", "abap", "active directory", "activecampaign", "admob", "adobe photoshop", "adtech", "adwords", "agile", "ai", "airflow", "aix", "ajax", "akka", "albanian", "alexa", "alexa skills", "alfresco", "algorithms", "amazon web services", "amazon-web-services", "ambari", "analytics", "andriod app development", "android", "androidstudio", "angular", "angular 2", "angular.js", "angular2", "angularjs", "animation", "ansible", "ant", "apache", "apache spark", "apache2", "api", "app", "app development", "app extensions", "apple", "application", "apps", "architect", "architecture", "arduino", "arm", "artificial intelligence", "asp.net", "asp.net mvc", "asp.net web api", "asp.net web forms", "assembly", "augmented reality", "aurelia", "aureliajs", "austin", "automate", "automation", "avada", "avr", "aws", "azure", "babel", "back end", "back-end", "backbone", "backbonejs", "backend", "backend developer", "bash", "beaglebone", "beautifu |