teleren/devto huggingface dataset:
How I bypassed Hulu's website geolocation error, so I could log in
Tags: javascript, tip, howto, discuss
Published: 2018-08-23 20:54:19

---
title: How I bypassed Hulu's website geolocation error, so I could log in
published: true
description: Hulu did a recent change on their site that broke the login, due to failure to record geo location
tags: javascript, tip, howto, discuss
---

## The issue

So I pay a monthly fee for Hulu, they rock and I love them. However, a recent change they did, made it so that in Safari it was giving me a geo location error and not letting me log in. It just sat at the welcome message.

![Imgur](https://i.imgur.com/maNwffT.png)

I have to use Safari, due to the reason that I use Pipifier to let me watch video, over the top of the rest of my screens (picture in picture). 

## The search

So here I am, clearing my cookies and double checking everything. I keep hitting "accept" on giving my location. Still nothing. So I do what any good developer does at this point. I open my developer console and get to digging.

First thing I see is `error [geo lib] – 2`... Well no wonder it's not doing anything then.

![Imgur](https://i.imgur.com/fxx89cd.png)

So next, I open up the error and click to the code so that I can see whats going on. I kind of ignore the main error, and follow the trace stack. I see that it's happing during the function that sets the cookie!

![Imgur](https://i.imgur.com/ohE9E6P.png)

Boom! I know that this means that most likely I can just find the logic that sets the cookie, and set it myself. I can see where it's calling `setCookie` and it has clear as day, the logic they use to create the cookie string.

I'm going to leave out how they set the cookie far as inner workings, but the cookie name ended up being `geo`.

So I take that logic, and I use it to replicate the cookie as it would. I can see I need my location, so I go and look up my location on google maps, get my lat and lon, then back to the code. 

I paste in the values real quick, and create the cookie via my console. 

## The solution
`document.cookie = "geo=" + "".concat(xx.xxxxxx, "&").concat(-xxx.xxxxxx, "&").concat(Date.now())`

Then I go back to Hulu, do a refresh and I'm in!!! 

![Imgur](https://i.imgur.com/HGVwwyL.png)

**NOTE!!!** 
This is NOT a hack, but a temporary fix. I pay full price monthly subscription and do not abuse my permissions. I do not promote misusing this in a malicious manor.

It's totally worth the money! 


## Feedback

Let me know your thoughts. Have you done similar things like this? 


---

Varymade LLC.

Current projects are https://charactergenerator4000.com and https://coder.exchange. Please check them out and let us know your thoughts.
Laravel VisitLog
Tags: laravel, php, visits, log
Published: 2018-08-23 19:40:43

---
title: Laravel VisitLog
published: true
description: VisitLog is a simple Laravel 5 package that can be used to log visitor information and save it into database.
tags: laravel, php, visits, log
cover_image: https://camo.githubusercontent.com/5206e966bad8f3a124f0bae396e48660e1714a30/68747470733a2f2f7261772e6769746875622e636f6d2f7361726672617a6e6177617a323030352f76697369746c6f672f6d61737465722f73637265656e2e706e67
---

VisitLog is a simple Laravel 5 package that can be used to log visitor information and save it into database.

{% github https://github.com/sarfraznawaz2005/visitlog %}
The Rails Ecosystem is Healthier than Ever
Tags: healthydebate, rails
Published: 2018-08-23 19:30:16

---
title: The Rails Ecosystem is Healthier than Ever
published: true
tags: healthydebate, rails
---

This is the first post in a new "flare tag" we're trying out: **#healthydebate**.

This tag is a place to create posts with the expectation of a debate. If you enjoy debating software topics or watching in on others debate, you might like this tag. I also hope it will encourage more disagreements to congregate in places where everyone has opted in with the understanding that this is a debate.

Of course, everyone must remain respectful. The code of conduct is important and always enforced throughout the whole site.

Have fun!

## On to my topic: Rails is doing awesome!

The ecosystem around Rails remains incredibly strong, and the organizations involved will push the tech forward.

This announcement got me particularly excited:

{% twitter 1030459285946417152 %}

{% twitter 1030461847256875008 %}

GitHub being on the bleeding edge of Rails is HUGE. Shopify has been leading the way of late, and I feel like this new involvement will push things even further ahead. Rails has done a great job of staying conceptually aligned and avoiding feature creep and complexity creep.

Whether or not you like the Rails API, the ecosystem remains strong.

Ruby is a weird choice for sprawling web frameworks, it sure seems like a toy scripting language, but things have just worked with Rails. The humans involved have pushed things forward.

Rails remains one of the best choices and is only getting stronger. Feel free to debate me on this!

_Others are welcome to take on this debate on my behalf. It's a community debate. I'm not sure how much I actually care to take part in the conversation. We shall see._ 😋

Happy coding!
Day One at JupyterCon
Tags: jupyter, python, datascience, machinelearning
Published: 2018-08-23 19:21:28

---
title: Day One at JupyterCon
published: true
description: Reflections on my first day at JupyterCon
tags: jupyter, python, data science, machine learning
cover_image: https://thepracticaldev.s3.amazonaws.com/i/pmsxtfg2ojpkm79u6lx9.png
---

I wrote up a few reflections on my first day at [JupyterCon](https://conferences.oreilly.com/jupyter/jup-ny). I built a [JupyterHub](https://github.com/jupyterhub/jupyterhub) cluster on [Kubernetes](https://kubernetes.io) in the cloud using [Helm](https://helm.sh), learned to visualize data effectively using [Matplotlib](https://matplotlib.org/), and learned how to deal with missing data and get realistic results even when you don't have a complete data set.

https://blog.osninja.io/jupytercon-day-one/
Finding the "best" Camera Settings for Rocket League.
Tags: webscraping, python, node, matplotlib
Published: 2018-08-23 19:01:35

---
title: Finding the "best" Camera Settings for Rocket League.
published: true
description: Scraping ballchasing.com and Graphing the Results.
tags: #webscraping, #python, #node, #matplotlib
---

By pulling the camera settings from 150,000 replays and only considering the settings of the team that won we can pretend to have found the "best" configuration.

Red bars indicate default camera settings.
0 is invalid data but i left it in because why not.

## Graphs showing the wins per configuration per option.



![Distance](https://pastebin.com/raw/pN1BAGFS "Most Wins: 280")
![Fov](https://pastebin.com/raw/mhKYi6xg "Most Wins: 110")
![Height](https://pastebin.com/raw/MjapnwTy "Most Wins: 110")
![Pitch](https://pastebin.com/raw/SaX5RS4J "Most Wins: -3, default")
![Stiffness](https://pastebin.com/raw/WHwN82cK "Most Wins: 0.3, default")
![Swivel](https://pastebin.com/raw/dkQdms7q "Most Wins: 2.5, default")


## About the Data

SunlessKhan on youtube put out a video for https://ballchasing.com/ recently which is a site that lets users upload replays from rocketleague.  It provides a pretty awesome way to view the replay in your browser, but also provides a ton of analytics, stats, and info about the match.

Camera settings always seem to be an interesting debate in the community.  So I decided to find out what settings most people are using.

## Getting the Data

I'll be honest, i was going to write out what i did but it actually turned out to not be very interesting.  It boiled down to.

1. Use css selectors to select the data you want.
2. You can use selectors to get links to the pages that contain the data you want, and to get the links to paginate to the next page.  This is especially useful for websites that don't have simple pagination urls.
3. Use node and cheerio.  Node makes it easy to scrape asynchronously while.
4. Use timers or timeout to be nice to the server.
5. Sometimes it's easier to output messy data and clean it up with things like `sed` and `tr`.


Here's the tool I used... it's pretty poorly written by me about a year ago and there's no comments in the code itself and it almost always mostly works.

{% github agentd00nut/css_scraper %}


The real power is that you can combine the `-n` next pagination selector with the `-d` depth selector.

The depth selector will apply all your `-t -f -l` selectors to every link it finds.
The next pagination selector will follow the link it finds to get to the next page.
Use `-p` to paginate only a certain number of times.

You'll likely want to use the `-r` to get non json styled output.


## Making the graphs

Again this ended up not being very interesting.  I just used matplotlib in python to increment a counter in a dictionary where they key was the camera setting for the team that won the match.

### I'm not even sure why i explained any of this.
Angular Is Crappy
Published: 2018-08-23 18:57:16

---
title: Angular Is Crappy
published: true
description: 
tags: 
---

Actually, this is my first post on dev.to. I've been trying to use or understand what angular is all about but it isn't sinking. I feel like Angular is over-engineered which makes it bulky for features easily implemented in React and Vue. I will be very happy if someone can give me a convincing reason to try it out. And mind you I'm a Vue lover.
Have you had to make your Python code run fast?
Tags: python, performance, discuss
Published: 2018-08-23 18:56:29

---
title: Have you had to make your Python code run fast?
published: true
description: Have you ever had to make snakes fly? 
tags: python, performance, discuss
cover_image: https://thepracticaldev.s3.amazonaws.com/i/kbw7qvdp2l00sp1j9ngf.jpg
---

Though performance is often cited as a reason people are skeptical of Python (see @grokcode's [recent post and the replies to it](https://dev.to/grokcode/99-problems-but-python-aint-one-1gj4) ), I haven't run into many performance issues in Python myself.  On the other hand, most of the programming I've done in Python hasn't been the kind where milliseconds matter (or if they did matter, it was already optimized by libraries like NumPy and Matplotlib).   

The one performance issue I had to deal with wasn't with Python itself, but with having to await the results of many database queries, and therefore needing to have multiple ones running at a time.  I spent some time trying to get multiprocessing to work, before realizing that threading was sufficient (as the Python code itself wasn't CPU-bound).  

Have you run up against performance issues in Python, or had to use it in a resource-constrained environment?  What kind of problems did you have?  What did you do to meet your performance needs?

Edit to add: If you've never run up against performance issues in Python after using it a lot, especially if there was some situation where you you thought performance was going to be a problem, I'd like to hear about too.
Testing Models, ModelMangers in Django
Tags: discuss, python, django, unittesting
Published: 2018-08-23 18:20:10

---
title: Testing Models, ModelMangers in Django
published: true
tags: discuss, python, django, unittesting
---

Hello all, I'm a bit shocked on the lack of example on how to test models and model managers in Django.

I tried to found out some nice examples on this topic, and I found it a bit challenging to found it out.

For example there is this nice blog post from [Brad Montgomery](https://bradmontgomery.net/blog/django-manager-testing-woes/), also this article from [Matt J Morrison](http://www.mattjmorrison.com/2011/09/mocking-django.html) and that is it, don't get me wrong they are nice but a bit outdated.

Perhaps the best one so far is this [Advanced user inheritance with Django](https://gist.github.com/vinyll/6103202) example.

I know Django provides nice documentation on how to run tests, but I like to check other people examples.

Where and how you guys found example on the testing when you need it?

Cheers.
Explain Stores (Vuex) Like I'm Five
Tags: discuss, explainlikeimfive
Published: 2018-08-23 15:11:23

---
title: Explain Stores (Vuex) Like I'm Five
published: true
description: 
tags: #discuss #explainlikeimfive
---

Hi everyone!

Could anyone explain me stores (Vuex or anyone) like I'm five? I don't understand.


Thanks!
How to Host an "Ask Me Anything" on dev.to
Tags: meta
Published: 2018-08-23 15:01:16

---
title: How to Host an "Ask Me Anything" on dev.to
published: true
description: 
tags: meta
---

I have been really happy to see more folks hosting AMAs. AMAs are great because it's a really great way to distribute nuanced views into the software world, and have folks get to know you. Everyone is welcome to host one, and I'll give a few tips:

## Your title should have a hook

Check out other AMAs in order to get a feel for what might be a good thing to center your AMA around. It doesn't have to be ultra unique, but how you phrase your title will dictate the AMA.

I really liked this one:

{% link https://dev.to/rapidnerd/ama-switching-from-a-software-engineer-to-a-games-developer %}

I think this gives readers an idea of what insights they might glean from checking out the conversation. You might really solve someone's career problem just by hosting a discussion centered around some element of your history/career.

## The body of your post should give a bit more detail but not be too long

The Q&A portion of the AMA is the good stuff. Keep your bio short and sweet.

## You can promote something in the body of the post, but don't be weird about it

Don't just use the AMA for promotion. We may remove the AMA if you go too far in this direction. You are more than welcome to do an AMA alongside a launch, it's a great use case. Just don't go too far with this.

## Keep up with the AMA over a few days

AMAs are designed to be somewhat asynchronous. Questions will keep coming in for a few days and then things will fade. So try to respond quickly but no need to be 100% back-and-forth because every AMA has a different pace.

## Use additional tags

If your ama is about VueJS, use tags like #javascript and #vue in addition to the #ama tag.

## Tell someone else to host an AMA

If you know someone who is not an active [dev.to](/) member, ask them if they are interested in doing an AMA. It is a great way to intro new folks to the community. Open source maintainers, industry leaders, etc. are always welcome to stop by!

## Planned/scheduled AMAs

Email yo@dev.to if you want to schedule an AMA in advance. Most of the time this isn't really worth bothering with, but we will definitely work with notable leaders in this way, or anyone where pre-announcing would be useful.

# Tips for AMA askers/readers

- Be supportive! There is absolutely no reason to be a hater in an AMA. There is always a respectful way to ask a question.
- Get in early! It is very helpful to get the convo going with quick questions, it helps out everyone.
- Ask follow-up questions once you get an answer!
- Chip in on adding your own answers or follow-ups to some questions where you can be helpful, but do so respectfully of the host. This is their space.
Golang & Angular Series - Part 1: Developing and Securing Golang APIs
Tags: go, angular, javascript
Published: 2018-08-23 14:55:11

---
title: Golang & Angular Series - Part 1: Developing and Securing Golang APIs
published: true
description: A series that will show you how to develop modern applications with Golang and Angular.
tags: #golang #angular #javascript 
canonical_url: https://auth0.com/blog/developing-golang-and-angular-apps-part-1-backend-api/
---

In this series, you will learn how to build modern applications with Golang and Angular. In the first article, you will build a secure backend API with Golang that will support a to-do list application.

[Read on 🚀](https://auth0.com/blog/developing-golang-and-angular-apps-part-1-backend-api/?utm_source=dev&utm_medium=sc&utm_campaign=stack_golang_angular)

![Golang & Angular Series - Part 1: Developing and Securing Golang APIs](https://thepracticaldev.s3.amazonaws.com/i/4avn2mwz8gfjhnbyrbgk.png)
Fire in London helped preserve the city of Savannah GA through the modern age
Tags: history
Published: 2018-09-18 02:47:07

---
title: Fire in London helped preserve the city of Savannah GA through the modern age
published: true
tags: History
canonical_url: https://www.briannipper.com/2018/08/fire-in-london-helped-preserve-city-of.html
---

| [![A view of Savannah as it stood the 29th of March 1734](https://upload.wikimedia.org/wikipedia/commons/4/41/A_view_of_Savannah_as_it_stood_the_29th_of_March_1734.jpg "A view of Savannah as it stood the 29th of March 1734")](https://upload.wikimedia.org/wikipedia/commons/4/41/A_view_of_Savannah_as_it_stood_the_29th_of_March_1734.jpg) |
| By Pierre Fourdrinier and James Oglethorpe  
[Public domain or Public domain], via Wikimedia Commons |

Once upon a time, before my wife and I had kids, we visited the city of Savannah, GA. We had the opportunity to take a carriage ride through some of the most oldest portions of the planned city. A detail of the tour that has stuck out in my mind was how much of the original street remained unchanged. The reason this stuck out was, as I had found in visiting a few other historic locations on the east cost of the US, many locations as old, if not older, had to be altered to accommodate motor vehicles. So why was that not the case for the planned city of Savannah GA? Because of fires in London. Huh?  
  
The founder of Savannah was [James Oglethorpe](https://en.wikipedia.org/wiki/James_Oglethorpe). Born in England in 1696, he would have been familiar with the fires that ravaged that part of the world in 1666. The [great fire of London](https://en.wikipedia.org/wiki/Great_Fire_of_London) burned through much of the city due to many factors, one of which was the way homes were built, basically right up against one another. Out of that fire a new approach to city building came into fashion that of having easements between homes to help avoid the spread of fire.  
  
This fascinated me as it turned out that in attempting to address the concern of fire by spacing out plots of lands and having larger pathways between the homes it resulted in a design that allowed the original layout to survive, more or less, down to our modern age.  
  
As time progressed and the advent of items such as cars came along Savannah found it self having plenty of room to allow cars to flow in both directions, for sidewalks to be put in, for construction of sewers and electricity to be distributed all without the need to tear down or reroute the flow of movement.  
  
Understanding the chain of events that caused choices to be made can be one of the most rewarding results in study of history.  
  
So dear reader, what historical tidbits have captured your interest?
A Tale of an Array Conversion Bug
Tags: php, javascript, bugs
Published: 2018-08-23 13:44:58

---
title: A Tale of an Array Conversion Bug
published: true
description: 
tags: php, javascript, bugs
---

In light of a Tweet from Ben, I thought I'd share a recent bug story.

{% twitter 1031231746677899264 %}

Moving array data from PHP to JavaScript is something I do regularly. Sometimes it's key/value pairs, other times it's a simple list of values.

In this particular instance, I needed an intersection of two arrays.

Here's a contrived example:

```php
$main_colors = ['yellow', 'blue', 'orange', 'brown'];
$other_colors = ['pink', 'purple', 'blue', 'brown'];
$intersection = array_intersect($main_colors, $other_colors);
```

It's then passed back to JavaScript as `json_encode($intersection);`.

On the JavaScript side, an array of values was expected, however, it received an object.

Wait... What?

It didn't take _too_ long to realize what the issue was, but longer than I care to admit. 😆

`array_intersect` maintains the first array's index order. In other words, `$intersection` is an array, structured as:

```php
[1] => 'blue',
[3] => 'brown'
```

Which translates to an object in JavaScript:

```javascript
{
  "1": "blue",
  "3": "brown"
}
```

Because the index numbers are maintained in the intersection, instead of it being a list of values, it becomes a list of key/value pairs.

The fix is easy enough, using `array_values`, which returns all the values of an array.

```php
$intersection = array_values(array_intersect($main_colors, $other_colors));
```

In PHP, `$intersection` is restructured as an ordered/indexed array:

```php
[0] => 'blue',
[1] => 'brown'
```

And when that's encoded (using `json_encode`) for JavaScript's usage, it looks like:

```javascript
['blue', 'brown']
```

Which is what I was expecting in the first place. 😀

{% twitter 1031240031074242560 %}
How to Fix that Heroku Push Error!
Tags: devops, heroku, git
Published: 2018-08-23 12:54:54

---
title: How to Fix that Heroku Push Error!
published: true
description: How to fix setting your app to the wrong Heroku git URL
tags: devOps, Heroku, git
cover_image: https://i.pinimg.com/originals/3b/83/f7/3b83f7d52fd9777fb123e3995f0914b0.jpg
---
You made a mistake pushing your code to the work account instead of your personal account!?!! The Horror! The Pain!! OMG... The PAIN!!!

Apparently you were on your PC and had logged into the work account the last time you made a push and now you have created a personal heroku app, most likely a weekend hobby project and yes, you pushed to the office dashboard... Hmmm. Well let's fix that shall we?

Here's how to fix that.

1. Log in to your account on Heroku via the CLI
```
heroku login
```
Enter your credentials. Apparently this is why you pushed to the wrong account in the first place! Duh!

2. Check the remote urls that your app is hosted on
```
// Check for the current url 
git remote -v
```

3. Well seeing as your current user account cannot push to the remote heroku url, we then have to delete it!
```
// remove remote url
git remote rm heroku
```

4. Now we have to create  a new Heroku app via the CLI since we are now logged into your user account
```
heroku create
```

5. You get a url at this point, which is also created on your heroku dashboard. Now set this url as the remote url for your app
```
git remote add https://git.heroku.com/<unique-heroku-app-name>.git
```

6. We can never be too careful! Just to be sure run
```
git remote -v
```

7. Now we are confident to push our app to heroku
```
git push heroku master
```

Phew! That was a close call mate!