teleren/devto huggingface dataset:
Setting pattern_options in a Plone relation field widget
Tags: plone
Published: 2020-12-03 19:35:39

---
title: Setting pattern_options in a Plone relation field widget
published: true
date: 2018-04-29 22:00:00 UTC
tags: plone
canonical_url: http://mrtango.planetcrazy.de/setting-pattern_options-in-a-plone-relation-field-widget.html
---

To use the full power of the RelationWidget in Plone 5, you can set some of the pattern\_options, which are described in the link [Mockup docs](http://plone.github.io/mockup/dev/#pattern/relateditems).

If you use a ReleationField, you usually want to browse thru all objects in the database, but only allow to select specific portal\_types.

The pattern <tt>relateditems</tt> which is used by the RelatedItemsFieldWidget, has options to configure this by setting the selectableTypes list (array).

You can pass the patter\_options argument to the widget configuration, with plone.autoform.directives like this:

```
directives.widget(
    'location',
    RelatedItemsFieldWidget,
    pattern\_options={'selectableTypes': ['location']},
)
locations = RelationList(
    title=\_(u'Locations'),
    value\_type=RelationChoice(
        title=\_(u'Related'),
        source=CatalogSource(),
    ),
    required=False,
)

```

This will update the pattern\_options with your provided config.

The same way you can add more confgiuration settings for the pattern, like the <tt>basePath</tt> for example.
No social media in the mornings - Day 6
Tags: career, productivity, mentalhealth
Published: 2018-04-29 21:39:37

---
title: No social media in the mornings - Day 6
published: true
description: Sixth day without checking social media in the morning.
tags: #career, #productivity, #mental health
---

Sixth entry and second to last entry on this no social media in the mornings journey. For more details you can check out my article [what would your life be without social media in the morning](https://dev.to/josegonz321/what-would-your-life-be-without-social-media-in-the-morning-1g2l).

Remember, my main goal is to inspire and motivate you.

Shall we continue to the journey?

## Day 6

1. **Turning off the alarm.** ⏰
    I had to do it again. The missus and I stayed up last minute having some drinks and doing some gaming. Usually, we don't stay up very late but we got into conversation. It's one of our things.

    I wanted to run early in the morning and get a good head start in day. But I was too sleepy and woke up later than planned.

2. **Let's run!** 🏃‍♂️
    Since today it's the weekend, my runs are longer. I don't think of how far or how long I'm going to run. I have a few tracks in my head and come back home. Simple is better for my brain.

    I didn't feel like exploring and decided to go to with my default run around my local lake. 

    It was perfect spring weather. My pace, breathing and mindset all were great. But most importantly, I was present in almost each step of the way enjoying the beautiful day.

    {% twitter 990641768269041664 %}

3. **Inspired and motivated**
    I was so inspired and motivated that I didn't think an article would capture what I was experiencing. So, I decided to make a short video instead:

    {% youtube 1cJN3SSrR4o%}

    I hope you enjoy it!

4. **Easy rest of day**
    As explained in the video, I took it easier the rest of the day. Just handled some family finances and prepared the the rest of the week. 

    In case you are wondering, yes, I had another drink. Wow, I sound like an alcoholic now. 🍸

## First time checking social media

- Twitter: 12:45pm
- Email: 12:30pm
- Dev.to: 1:00pm
- Crypto currency: 2:30pm


Hey, not bad for a weekend, which is my weak point. But I did pretty good!


## Conclusion

Rest is very important to the mind, body and spirit. All of us have different ways to rest it up and recharge those batteries. 

Sometimes, **we need less distraction in our lives in order to enjoy the present...the now**.

What about coding? What about 'hacking' on my side project? That's important but other things are more important in life. 

It is true that I provide software solutions for my clients. But that doesn't define me as a person, as a human being.

What would you discover on your journey? 🙂

Thanks for reading. Till tomorrow!
Announcing Vue Github Activity: A Vue.js Component to include a GitHub feed into your project/website
Tags: vue, projects, webdev, showdev
Published: 2018-04-29 21:00:33

---
title: Announcing Vue Github Activity: A Vue.js Component to include a GitHub feed into your project/website
published: true
description: This Simple Vue component creates a feed panel with your recent GitHub activity. It displays the user's name,  login, photo, and a list of each individual activity type.
tags: vue, projects, webdev, showdev
cover_image: https://images.pexels.com/photos/6076/wood-road-forest-path.jpg?auto=compress&cs=tinysrgb&dpr=2
---

*Originally published on my [blog](https://redknot.io/articles/vue-github-activity)*

This Simple Vue component creates a feed panel with your recent GitHub activity. It displays the user's name,  login, photo, and a list of each individual activity type.

A couple months ago, I started renew my portfolio website, I picked Vue.js for that mission, since is a pretty trendy language in this moment and i felt curiosity about what can I do with that. I started redesigning all the site, and deciding what information should I show on it, at the end of the initial sketch I added the first four panels on the website including the skills information, latest projects, work experience and the latest blog posts.

With a quite minimalistic design, I expend about a week and half build the MVP and put it online. Then I requested a few feedback from my near friends, about what they thought regarding the UX, design and so on.

After the feedback session I fixed a little design issues,  included the new Spotify playlist panel, and received a big suggestion.. someone told me "Hey, you should add a feed about your GitHub activity". In that moment were a pretty busy weeks, so I stoped that suggestion on stand by, However few weeks ago I decided retake it with an extra, I was curious about the Vue external component developing , so I developed that panel as external dependency and published it on NPM.

Initially the MVP for that project was a quite modest, since my motivation was the fact to develop the component perse, once I released the first version, the next step was improve and fix somethings include the components internal structure and bundling, so I expend a couple more weeks to publish the improvements as dependency versions.

As I said the project was published on [NPM](https://www.npmjs.com/package/vue-github-activity) and of course totally open sourced, released under MIT license,  and it [repository](https://github.com/lexmartinez/vue-github-activity) is open for any kind of contributions, issues, comments, pull-requests, etc. Currently I use this component on my [website](http://lexmartinez.com) you can check it out alive there but here there is an small screenshot.

![](https://github.com/lexmartinez/vue-github-activity/raw/master/screenshot.png)

Before to end, special thanks to this [repository](https://github.com/caseyscarborough/github-activity) of @caseyscarborough it highly inspire the sketching process for this component.

**Thanks for reading.. and hope you enjoy it! I'll be here for any feedback!**
Choosing PHP in 2018
Tags: webdev, php
Published: 2018-04-29 18:55:26

---
title: Choosing PHP in 2018
published: true
description: Why you should use PHP to write code in 2018
tags: webdev, php
cover_image: https://thepracticaldev.s3.amazonaws.com/i/9hgcalehexiy3aettl4n.png
---
I bet you do not see those words very often.

We live in a time where there are a plethora of programming languages and frameworks. As web developers, we have so many options, it can be very difficult to know what to learn and use to build a modern website. If you check StackOverflow, Hacker News or Twitter, you will see thousands of different opinions about what language you should be using. In many cases, you will see developers making fun of PHP, trying to convince you to use something “better”. I am here to tell you not to listen to them.

PHP has a low reputation for a couple reasons. First, the standard library lacks some consistency in a few areas. Second, it is a more approachable language leading to more beginners using it and some poorly architected systems being made. Both problems are easily combated with better training and education which we have plenty of in 2018.

By contrast, PHP has some great features going for it. First, it has several excellent web frameworks like Laravel and Symfony. Both are easy to learn and give you a great head start in building a website. Second, PHP is modernizing with better speed and excellent package management with Composer. The PHP 7 series has provided almost double performance, making it a very snappy scripting language. Composer provides great third-party package management on par or better than others like npm or Bundler. Third, PHP has an excellent object oriented class system and also supports functional programming features. It’s object oriented nature makes it simpler to write maintainable, clean and organized code. Fourth, PHP is still one of the easiest languages to deploy to a server. Most web hosts support a one-click install for PHP making it really easy to get your site in the hands of users.

It is a great time to start learning PHP. Don’t worry about the haters, just go make something great!

If you want to learn more, here are a few sites that have helped me:
http://php.net/index.php
https://www.phptherightway.com/
https://laravel.com/
https://www.laracasts.com/
https://symfony.com/
https://getcomposer.org/
https://packagist.org/

If you have been using PHP, write a comment about it so everyone can see the cool stuff you are building with it!

*The PHP logo is from: http://php.net/download-logos.php*
New Version of Ruby Gem markdown_helper
Tags: ruby, github, markdown, documentation
Published: 2018-04-29 18:32:55

---
title: New Version of Ruby Gem markdown_helper
published: true
description: Added first use cases;  changed treatment :verbatim to :markdown.
tags: ruby, github, markdown, documentation
---
I have put up a new version of Ruby [gem markdown_helper](https://github.com/BurdetteLamar/markdown_helper#markdown-helper).

Section [What's New?](https://github.com/BurdetteLamar/markdown_helper#whats-new) is at the top of the README.
adding an External Font in a PDF file using apoche pdfbox Java
Tags: javapdfbox
Published: 2018-04-29 17:52:40

---
title: adding an External Font in a PDF file using apoche pdfbox Java
published: True
description: Hi i want to add an external Font with apoche pdfbox in java to an PDF file can you please tell me how can I do that I researched every where didnt find something I could use
tags: Java PDFBOX 
---
🏎Create fake REST API in one sec (written in Go)
Tags: go, fakeapi, rest, json
Published: 2018-04-29 17:27:03

---
title: 🏎Create fake REST API in one sec (written in Go)
published: true
description: 
tags: go, fake-api, rest, json
---

Do you ever wanted to create a REST API with just a JSON file? I think so, and there are many tools to that but not written in Go :D so give `jhop` a try and have fun.

https://github.com/cooldrip/jhop
A python script that shows the distribution of IT companies in Goa India.
Tags: showdev, firstpost, python
Published: 2018-04-29 16:11:09

---
title: A python script that shows the distribution of IT companies in Goa India.
published: true
description: 
tags: #showdev,#firstpost,#python 
---
![IT companies in Goa](https://thepracticaldev.s3.amazonaws.com/i/gpumppfwyv8fuwp05btv.png)


Recently I was learning web scraping using *BeautifulSoup* library in python.After learning the basics concepts of web scraping, I wanted to use to use it to write some real-world program.

While browsing the internet I came across website [startupgoa.org](http://startupgoa.org/companies/#.WtIhBXVubZs) which have a list of startups in Goa, India [FYI I am from GOA].

So I decided to write a python script that will 
* Scrap this list of companies in Goa.
* Get location (latitude & Longitude) of these using Geocoder(I used Google geocoder API).
* Plot those points on the map using a python package _Folium_


After lots of googling & searching for answers on StackOverflow below is the end result.

[Demo :https://ns23.github.io/startupGoaMap/](https://ns23.github.io/startupGoaMap/)

[Github Repo](https://github.com/ns23/startupGoaMap)

Please do provide feedback & let me know in comments if I can improve this script.
Python: Resizing and Fitting an Image to an Exact Size
Tags: python, tip, image, dataanalysis
Published: 2018-04-29 15:19:19

---
title: Python: Resizing and Fitting an Image to an Exact Size
published: true
description: 
tags: python, tip, image, data_analysis
---

Often, when working on image analysis in Python, you’d want to resize your images to uniform dimensions (usually, a power of 2). Here is one simple and proven way to resize an image of arbitrary size, down to the exact dimensions you want. If the new dimensions do not match the original ratio, the image will be cropped, starting from the center, in order to match the newly desired ratio.

```python
from PIL import Image, ImageOps

original_image = Image.open("path/to/image")
size = (512, 512)
fit_and_resized_image = ImageOps.fit(original_image, size, Image.ANTIALIAS)
```

with help from [StackOverlow](https://stackoverflow.com/a/8469920/1107412)
まっすぐな線を引く方法
Published: 2018-04-29 13:30:49

---
title: まっすぐな線を引く方法
published: true
description: 寓話です
tags: 
---

むかしむかし、ある村の技師が、『まっすぐな線を引く方法』を思いつきました。その方法は、他の技師たちが使っている方法とは全く異なるものでした。ですが、彼の発想や、その為に彼が拵えた道具は、工法の伝統に則ったもので、正統さと、ある種の古めかしささえ備えていました。誰かの参考になればと、彼はその工法や道具の設計図を公表しました。

すると、村の別の技師がやってきて、こう言いました。
「原理がわからないわけではないのだが、手引書のようなものを作ってくれないか。」
彼は簡単な手引も一緒に公表することにしました。その後、その技師から連絡はありませんでした。

しばらくすると、また別の技師がやってきました。
「手引書がわからないわけではないのだが、周りであなたの工法を使っている人がいない。用例を教えてくれないか。」
彼は簡単な用例を、手引に添えることにしました。ところが、その技師からも連絡はありませんでした。

ほどなくして、先ほどとは別の、村では著名な技師がやってきてこういうのです。
「その状況であれば、線は必ずしもまっすぐである必要はないのではないか。」
その発言に続くように、村の技師たちは口々にこの工法への非難を始めました。
「今我々が使っている道具でも、ほぼまっすぐな線は引けている。この工法に切り替えなければならない理由を教えてほしいし、我々の工法や道具への悪意を感じる。」
「この方法であれば確かにまっすぐな線が引けそうではある。それはそうだとしても、いつもそんなことに気を使っている時間はない。理想的ではあるが、甚だ現実的ではない。」
「手引書や用例が不親切で、あまりに独善的すぎるのではないか。それに学習コストの面から見ても、新たに覚えることが多すぎる。」

この騒動は、技師ではない人たちの間でも少しだけ話題になりました。
そのせいか、村ではこの年、技師ですらない詐話師が書いた「まっすぐは（あとでいかようにも）作れる！」という本と、自称技師の人が書いた「（ほとんどの場合）まっすぐである必要はなかった！」という本がよく売れたそうです。（タイトル内の括弧書きは筆者の補足。）

彼とその弟子たちは、途方に暮れました。自分たちが公表した工法や道具が、まさかこのような形で受け取られるとは思いもよりませんでした。彼は、この工法を使うべきだと強要したわけでも、これこそが唯一最も正しい工法だと断言したわけでもないのです。彼の工法で引いた線がまっすぐなであることと、従来の方法で引いた線が必ずしもまっすぐでないこととは、何の関係もないことです。なぜ、ある正しさ（ここでは線のまっすぐさ）をそのままにせず、相対化してしまうのでしょうか。あるいは理想と現実をごちゃ混ぜにしてしまうのか。もしかしたら正しさは、正しいというだけで挑発的であるのかもしれない、とも思いました。

ある日、どこで噂を聞いたのか、遠方から他の国の技師が彼の元にやってきました。
「あなたがあのまっすぐに線を引く人ですか？」
その技師は、彼の話や道具にイカサマがなく、彼の引いた線がまさしくまっすぐであることを確認すると、大いに彼を礼賛し、二人はすっかり意気投合しました。その技師は、自分の国でもこの工法と道具の作り方を広めていいか、と了承を得て、帰国の途に着きました。それ以来二人は文通友達になりました。

あれから数年が経ち、村の技師たちの中にも、賛同してくれる人も増え、彼の工法に則った新しい道具も数多く作られるようになりました。少しずつ彼の工法は広まりつつあるようです。

おしまい。
Fundamentals of Data Visualization
Tags: links, shares, dev
Published: 2020-07-07 09:34:45

---
title: Fundamentals of Data Visualization
published: true
date: 2018-04-29 12:06:51 UTC
tags: Links,Shares,dev
canonical_url: 
---

![Cover image](https://serialmentor.com/dataviz/cover.png)<figcaption><a href="http://serialmentor.com/dataviz">Fundamentals of Data Visualization</a></figcaption>

This is the website for the book “Fundamentals of Data Visualization,” published by O’Reilly Media, Inc. The website contains the complete author manuscript before final copy-editing and other quality control.
Setting Anaconda PATH on windows
Tags: anaconda, path, windows
Published: 2018-04-29 09:47:44

---
title: Setting Anaconda PATH on windows
published: true
description: Setting Anaconda PATH on windows
tags: Anaconda, path, windows
---


# Anaconda PATH Settings

I have installed Anaconda inside `C:\Anaconda5.1Python3.6` directory.

In my case, I have the following 5 `paths` as the value of **PATH** environment variable. I have appended these PATHs one after one by putting `;` as a separator of 2 PATHs.



	C:\Anaconda5.1Python3.6
	C:\Anaconda5.1Python3.6\Library\mingw-w64\bin
	C:\Anaconda5.1Python3.6\Library\usr\bin
	C:\Anaconda5.1Python3.6\Library\bin
	C:\Anaconda5.1Python3.6\Scripts


Now you can start new **Anaconda promt** or **Windows command line** and type the below command to check Python version.

	python --version

You can also run **Python interpreter** by typing the below command on **Anaconda prompt** or **Windows command line**.
	
	python


Everything is ok if you are able to get into the Python interpreter and execute Python statements.
Coursehunt: Hunt your courses for free !
Tags: opensource, productivity, showdev, javascript
Published: 2018-04-29 09:45:07

---
title: Coursehunt: Hunt your courses for free !
published: true
description: An Electron application for downloading courses.
tags: opensource, productivity, showdev, javascript
---

<img src="https://thepracticaldev.s3.amazonaws.com/i/llonxno0e2pi13dcz2uy.png">

## Coursehunt
A desktop application made and built with Electron which gives you an ability to batch download free courses provided by <a href="coursehunters.net">coursehunters</a>. Now, Coursehunters is a platform wherein they provide free online courses to be downloaded, indeed spreading knowledge around the globe. 

The desktop app is completely open sourced on <a href="https://github.com/theIYD/coursehunt">Github</a> and is available for Windows. 

_**Note:** The app will be available to other platforms in future releases._ 

### Show some love ❤️
In case you loved the project, leave a star on the repository so as to help the project to grow more and more.

### Contribute 🙌
Feel free to fork the project, and open pull requests. 

Happy Coding !
oracle training institute in noida 
Tags: oracle, bestoracle
Published: 2018-04-29 09:19:21

---
title: oracle training institute in noida 
published: true
description: oracle training institute in noida  webtrackker is the best Training institutes in noida 24x7 Lab Facilities Smart classrooms.Webtrackker Technology is one of reputed institutes in Noida.  more info@webtrackker.com or 8802820025,0120-4330760 visit here http://webtrackker.com/Oracle-DBA-Training-institute-in-Noida.
tags: oracle,best oracle
---
Dawn of the Hybrid CDN
Tags: cdn
Published: 2018-04-29 08:09:30

---
title: Dawn of the Hybrid CDN
published: true
description: This presentation is an overview of what makes Commons Host uniquely fit to achieve the huge goal of becoming the world's largest CDN.
tags: cdn
---

I performed this talk at the [Web Performance Singapore](https://www.meetup.com/Singapore-JS/events/249730512/) meetup. This new meetup is organised by yours truly and its first session hosted by Cloudflare Singapore office. It was great to get Little Lamb into the hands of over 50 attendees.

As a result several generous sponsors so far funded half a dozen servers to be deployed in Vietnam, Malaysia, and Singapore. I also received a donation of several cloud VPS instances.

Amazing community response. Thanks everyone! ❤️ Expect more Commons Host CDN PoPs to go live in the coming weeks and months.

{% youtube MXQmrZPH1vg %}

[https://www.youtube.com/watch?v=MXQmrZPH1vg](https://www.youtube.com/watch?v=MXQmrZPH1vg)

Thanks to [Engineers.SG](https://engineers.sg) volunteers for recording.
Little Lamb Mk I
Tags: hardware, cdn
Published: 2018-04-29 07:45:58

---
title: Little Lamb Mk I
published: true
description: The smallest CDN edge server to build the largest CDN network.
tags: hardware, cdn
---

This little CDN edge server is open hardware, runs a completely FOSS stack, and is very affordable. These attributes make it a key enabler for many deploying CDN Points-of-Presence (PoPs). Especially in areas without traditional datacentres. The goal is to get closer, in terms of latency, to the entire global population than any other CDN.

![Little Lamb Mk I](https://thepracticaldev.s3.amazonaws.com/i/bpeqgctpec1ply0arsc9.jpg)

The Mk I hardware consists of a [HardKernel Odroid HC1](http://www.hardkernel.com/main/products/prdt_info.php?g_code=G150229074080) with a 250 GB Samsung 850 EVO SSD. Its power-efficient 8-core ARM CPU serves [well over 800 Mbps in benchmarks](https://twitter.com/sebdeckers/status/987151171251945473). Since the 6 Gbps SATA drive is bottlenecked by the 1 Gbps network interface, I am looking at optimising for cost by using a cheaper SSD that maintains similar IOPS.

The Mk I model is [now available for sale](https://carousell.com/p/commons-host-cdn-pop-edge-server-166149743/). Automated deployment and dashboard integration is coming soon.

Pricing is currently calculated as follows:

1. Bill of Materials (BOM)
1. +10% source shipping & handling (S&H)
1. +7% GST ([gahmen](https://en.wiktionary.org/wiki/gahmen))
1. +33% setup fee

So, by building your own server you could save 25%. To put that into perspective, a rule of thumb for hardware startups is to charge 200% markup to stay profitable. So, clearly, at a fraction of the usual margin, I am not starting a hardware business. Commons Host is a network business. By keeping the hardware margin low, and the software free as in gratis, more servers will be deployed. [Metcalfe's Law](https://en.wikipedia.org/wiki/Metcalfe's_law) predicts that the value of the network should increase exponentially.
my zsh setup
Tags: zsh, devtools
Published: 2018-04-29 06:42:58

---
title: my zsh setup
published: true
description: 
tags: zsh, devtools
---
My MacOS terminal (iterm2) setup is based on https://github.com/getantibody/antibody and https://github.com/sindresorhus/pure

So simple and way faster than oh-my-zsh

Check my .dotfiles at https://gitlab.com/ramlevdk/dotfiles
What kind of music do you listen to while working?
Tags: discuss
Published: 2018-04-29 06:17:03

---
title: What kind of music do you listen to while working?
published: true
tags: discuss
---

Looking for what others find good for their productivity or code writing. What kind of music do you listen to that gets you in the zone?

For me, it can be anything from classical to metal, lofi to an entire playlist of hans zimmer.