##Config ###Recovery Mode (Single User Mode, --single)
- no network
- skips auth
###About pstgresql.conf <- Base Config pstgresql.auto.conf <- Overrides base config
- Set with
ALTER SYSTEM9.4+
##Config ###Recovery Mode (Single User Mode, --single)
###About pstgresql.conf <- Base Config pstgresql.auto.conf <- Overrides base config
ALTER SYSTEM 9.4+| # lib/harvesters/yelp_harvester.rb | |
| class YelpHarvester | |
| def initialize restaurant | |
| yelp_business_id = get_yelp_id(restaurant.yelp_url) | |
| @yelp_data = Yelp.client.business(yelp_business_id) | |
| end | |
| def get_yelp_id url | |
| url.slice!("http://www.yelp.com/biz/") | |
| return url |
| # spec/harvesters/yelp_harvester_spec.rb | |
| require 'rails_helper' | |
| require 'harvesters/harvester_index' | |
| require 'harvesters/yelp_harvester' | |
| describe HarvesterIndex do | |
| it "gets rating" do | |
| restaurant = Restaurant.create!({ | |
| name: "Test Name", | |
| yelp_url: "http://www.yelp.com/biz/ovo-cafe-san-francisco" |
| # lib/harvesters/harvester_index.rb | |
| class HarvesterIndex | |
| def self.yelp | |
| restaurants = Restaurant.where.not(yelp_url: nil) | |
| restaurants.each do |restaurant| | |
| yelp_harvester = YelpHarvester.new(restaurant) | |
| yelp_harvester.populate_data | |
| yelp_harvester.populate_tags | |
| end |
| namespace :restaurant do | |
| desc "TODO" | |
| task get_yelp: :environment do | |
| end | |
| end |
| # lib/tasks/restaurant.rake | |
| require 'harvesters/yelp_harvester' | |
| require 'harvesters/harvester_index' | |
| namespace :restaurant do | |
| desc "Pull yelp information from yelp api" | |
| task get_yelp: :environment do | |
| HarvesterIndex.yelp | |
| end |
| require 'benchmark' | |
| array = %w( | |
| 18 5 11 67 55 16 63 15 35 97 9 7 40 42 14 98 50 94 16 86 34 2 39 12 43 42 49 77 48 85 94 57 59 65 96 2 85 59 5 35 28 17 68 55 43 43 73 68 97 79 84 58 34 83 16 7 67 79 24 76 53 43 8 55 56 91 4 44 61 86 73 14 42 60 61 33 58 37 96 73 4 31 8 17 27 60 33 77 6 98 71 12 73 75 97 4 7 83 30 54 | |
| ).map! {|x| x.to_i} | |
| def collapse_sort(array) | |
| sorted = [] | |
| array.each do |item| | |
| if sorted[item] | |
| sorted[item].flatten! if sorted[item].class == Array |
| fs = require('fs') | |
| fs.readFile('text.txt', 'utf8', function (e,data) { | |
| processFile(data); | |
| }); | |
| function processFile(content) { | |
| var wordArray = content.replace(/'/g,"").replace(/[, *\n().?!;:]/g, "@").replace(/@{2,}/g, "@").split("@") | |
| wordArray.splice(wordArray.length-1) | |
| var t_words = wordArray.length |
| @-webkit-keyframes wiggle { | |
| from {-webkit-transform: rotateZ(10deg);} | |
| 50% {-webkit-transform: rotateZ(-10deg);} | |
| to {-webkit-transform: rotateZ(10deg);} | |
| } | |
| #rock{ | |
| position: absolute; | |
| top: 200px; | |
| width: 200px; |
| function sleep(milliseconds){ | |
| var start = new Date().getTime(); | |
| for (var i = 0; i < 1e7; i++){ | |
| if ((new Date().getTime() - start) > milliseconds){ | |
| break; | |
| }; | |
| }; | |
| }; | |
| while (true){ |