This file contains hidden or 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 'mechanize' | |
require 'pp' | |
require 'logger' | |
require 'pry' | |
require 'youtube_it' | |
#This is a great lesson of overcoding, I started with RubyTapas's boiler plate code thinking it'll be faster to code | |
#on top of his own stuff. But it ended up being overkill and terribly verbose. | |
#Abstracting the session is not necessary in this case and a terrible amount of overhead for a simple script. | |
#Especially when I use "click" on Mechanize::Link class. Which uses the same fucking session anyway! |
This file contains hidden or 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 'httparty' | |
require 'pp' | |
API_KEY = 'string' | |
#outputs filesize in bytes | |
module StreetView | |
include HTTParty | |
def self.image location | |
File.open(ENV['HOME']+"/#{location}.jpeg", 'w') { |file| file.write get('http://maps.googleapis.com/maps/api/streetview', :query => {:size => '1200x1200', :location => location, key: API_KEY, sensor: false}) } |
This file contains hidden or 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
%w{csv mechanize pp mongo peach parallel}.each { |x| require x } | |
include Mongo | |
@coll = MongoClient.new("localhost", 27017)['etsy']['stores'] | |
def extracted url | |
@agent = Mechanize.new { |agent| agent.user_agent_alias = 'Mac Safari' } #resets cookies, prevent some tracking | |
page = @agent.get url |
This file contains hidden or 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
cut -d',' -f6 #Close prices in sheet | |
awk 'NR>1{print $1-p} {p=$1}' #changes in close prices | |
awk '{if ($1 != 0) print $1}' #no zeros | |
perl -ne 'print $_ < 0 ? -1 : 1, "\n";' #up-down format |
This file contains hidden or 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
.NET Compact Framework | |
.NET Framework | |
.NET Remoting | |
.NET for Web | |
1ShoppingCart | |
A/B Testing | |
A2Billing | |
ADK | |
ADO.NET |
This file contains hidden or 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
// Find all YouTube videos | |
var $allVideos = $("iframe[src^='//www.youtube.com']"), | |
// The element that is fluid width | |
$fluidEl = $("body"); | |
// Figure out and save aspect ratio for each video | |
$allVideos.each(function() { | |
$(this) |
This file contains hidden or 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
on_submit: "fbq('track', 'Lead');" | |
on_submit: "ga('send', 'event', 'Contact Page', 'Received Submission');" | |
on_sent_ok: "ga('send', 'event', 'Contact Page', 'Email Sent Successfully');" |
This file contains hidden or 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
#this won't work as a script as you'll get user prompts that you should read. Just run each line individually. | |
#this is a blend of what's found on google, but re-arranged into a faster deploy. | |
#via: https://www.howtogeek.com/276468/how-to-use-a-raspberry-pi-as-a-networked-time-machine-drive-for-your-mac/ | |
#and: http://www.techradar.com/how-to/computing/how-to-make-a-mac-time-capsule-with-the-raspberry-pi-1319989 | |
# On your mac, make sure the USB hard drive is HFS+ (The better filesystems are more annoying to work with on Mac), with the appropriate permissions. | |
# In terminal write: "chmod 777 /Volumes/Time\ Machine && ls -l /Volumes" (Replace "Time\ Machine" with whatever your drive is called) | |
# You can connect the drive to your pi now. | |
#update system |
This file contains hidden or 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
training loss at step 0: 5.18 (2017-03-26 23:00:12.958387) | |
training loss at step 10: 6.79 (2017-03-26 23:02:21.577157) | |
training loss at step 20: 3.92 (2017-03-26 23:04:36.139422) | |
training loss at step 30: 3.57 (2017-03-26 23:06:38.333611) | |
training loss at step 40: 5.11 (2017-03-26 23:08:37.515464) | |
training loss at step 50: 4.66 (2017-03-26 23:10:37.834948) | |
training loss at step 60: 3.52 (2017-03-26 23:12:37.144137) | |
training loss at step 70: 3.23 (2017-03-26 23:14:36.581871) | |
training loss at step 80: 3.22 (2017-03-26 23:16:36.372585) | |
training loss at step 90: 3.26 (2017-03-26 23:18:44.086892) |
This file contains hidden or 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
Model Name: MacBook Pro | |
Model Identifier: MacBookPro10,1 | |
Processor Name: Intel Core i7 | |
Processor Speed: 2.6 GHz | |
Number of Processors: 1 | |
Total Number of Cores: 4 | |
L2 Cache (per Core): 256 KB | |
L3 Cache: 6 MB | |
Memory: 16 GB | |