teleren/devto huggingface dataset:
Does Github Pages Support User-Generated Content?
Tags: github, githubpages, website
Published: 2018-12-28 10:45:55

---
title: Does Github Pages Support User-Generated Content?
published: true
description: Github Pages
tags: Github, Github Pages, Website
---
I am thinking of creating a meme sharing site and the possibility of creating profiles of users was cut of after I discovered that Github Pages didn't support data base editing like traditional web hosts. 
So I turned to the idea of letting users submit their content (images in this case) anonymously (or with a one-time username). 

Is it possible to have user generated content hosted on Github Pages without me having to upload each image for them?

Thanks
IntroJS: javascript / jQuery module to introduce your app for first time visitors. https://github.com/iamdshri/introJS
Tags: webdev, javascript, jquery
Published: 2018-12-28 10:43:56

---
title: IntroJS: javascript / jQuery module to introduce your app for first time visitors. https://github.com/iamdshri/introJS
published: true
description: javascript / jQuery module to introduce your app for first time visitors.https://github.com/iamdshri/introJS
tags: webdev, javascript, jquery
---
How is a program on linux executed?
Tags: linux, exe, elf, main
Published: 2018-12-28 02:16:24

Just a self notes to refresh my mind on this, as it keep popping from time to time and I have to google it to answer the question.

* [How program executed?](https://linuxgazette.net/84/hawk.html) - keyword "how main() executed".
* Wikipedia [Execution (computing)](https://en.wikipedia.org/wiki/Execution_(computing)) - not much concrete information but still useful to trigger the long term memory section in your brain ;)
* [Understanding the Memory Layout of Linux Executables](https://gist.github.com/CMCDragonkai/10ab53654b2aa6ce55c11cfc5b2432a4) - keyword - "linux start memory address".
* This post on [building OS with Rust](https://os.phil-opp.com/minimal-rust-kernel/) also informative on how OS being loaded and execute program.

## Injecting into running process

* Attach to the a current running process by gathering its PID.
* Send a SIGSTOP to the program to halt it's execution
* Dump its registers (specifically rip/eip)
* Write your code to the stack where rip is pointing to.
* Send a SIGCONT to the program to return control.
* Profit.

https://www.real0day.com/hacking-tutorials/2017/11/6/injecting-a-running-process-linux

Also look into [how strace work](https://blog.packagecloud.io/eng/2016/02/29/how-does-strace-work/).

## Summary

* main() was defined in libc - the function in libc that assume the first function in C program to call is named `main()`.
* What address to load that contain the start of the program is defined in ELF headers. 

https://stackoverflow.com/questions/7187981/whats-the-memory-before-0x08048000-used-for-in-32-bit-machine

## Other similar topics

* [What happens when you type google.com into your browser's address box and press enter?](https://github.com/alex/what-happens-when)
* What happens when you switch on your computer? Unlike above question, I can't find single good write-up, just too many of them:-
  - https://bhavyanshu.me/what-happens-when-you-switch-on-your-computer-facts-that-most-computer-science-engineers-wouldnt-know/10/20/2014/
  - https://medium.com/10xcod3r/what-really-happens-when-you-switch-on-a-computer-defe74ccaba4
  - https://www.quora.com/What-exactly-happens-when-we-switch-on-the-computer
Q: How Much of "the Kotlin Way" Is the Right Way?
Tags: discuss, kotlin, java, scala
Published: 2018-12-28 10:43:46

---
title: Q: How Much of "the Kotlin Way" Is the Right Way?
published: true
description: 
tags: devdiscuss, kotlin, java, scala
---

*NOTE: This post was originally intended to provoke a discussion, and despite its length, the original goal is still the same. Please, share your feedback*

---

My experience with the JVM dates back from around 2010. Java in those days was a bit different from todays' standpoint. Java 6 was the current standard at the time, but most projects I got to work on, were stuck between Java 4 and 5. Those were tough beasts. More verbose and tedious to write code in.

At that time, we began searching for a way to release the burden of writing code, but keep relying on the vast adoption of the JVM. Groovy and Scala were the two alternatives offering more language expressiveness with less boilerplate and ceremony. And, while Groovy somehow never picked up the self-esteem to be seen as something more of a scripting language for build orchestration and runtime in-app plumbing, Scala looked like the bold and sexy future of the JVM.

That is, until the language and its community ideologically drifted apart from Java. Although most of the existing Java libraries at the time were compatible and accessible from the Scala runtime, those were seen as archaic, tedious to work with, and simply not built *"the Scala way"*. This slogan was used to justify the building of a whole new ecosystem of tools, libraries, and frameworks, written from the ground up with Scala in mind. It is safe to say that nowadays for every Java library out there, one could find two or three Scala equivalents written *"the Scala way"*. I am not much of a Scala expert, but IMHO, this has led to a total separation between the two communities, each re-inventing the wheel its own way.

Kotlin was supposed to help solve all of that. Having joined the game late enough, JetBrains put a bet on Kotlin's inter-operability with standard Java code. To achieve this, a language has to be perceived as a companion, and not as a true paradigm shift. For the three years I have worked with and followed Kotlin's development, there have been only a few minor occasions when the inter-operability did not work on 100%, and those were more or less edge cases. It seemed that had finally reached the golden mean, where multiple language paradigms can co-exist and their communities cooperate in order to achieve a common goal.

Yet, this is not quite what is happening. I have seen the birth of a Kotlin-first community of developers, preaching things *"the Kotlin way"*. Soon enough, tools, libraries, and frameworks started appearing, having perfectly working equivalents in Java, but written in *"idiomatic Kotlin"*. I started wondering where I had seen this before 🤔. 

Don't get me wrong, I am 100% for challenging the Status Quo, but by stepping on what already works well, and not merely throwing it off-board, because it was not built *"the XYZ way"*.

And what do you think?
Angular 9|8|7 Firebase Tutorial – Save User Data in Local Storage
Tags: angular, angular987firebase, angular987, saveuserdatainlocalstorage
Published: 2020-01-31 20:11:14

---
title: Angular 9|8|7 Firebase Tutorial – Save User Data in Local Storage
published: true
tags: Angular, Angular 9|8|7Firebase, Angular 9|8|7, Save User Data in Local Storage
canonical_url: https://www.positronx.io/save-user-data-in-local-storage-using-angular-7-firebase/
---

The post [How to Save User Data in Local Storage using Angular 7 Firebase?](https://www.positronx.io/save-user-data-in-local-storage-using-angular-7-firebase/) appeared first on [positronX.io](https://www.positronx.io).


Today we are going to create a simple app in which we are going to save user data in local storage using Angular 7 and Firebase real-time database. I will be showing you how you can maintain the user state even after you refresh the page in the Angular and Firebase.

I am going to use a simple logic when a user logs in the app we will **save the user data in local storage**. When a user logs out from the Angular application we remove the user data from local storage and set it to **null**.


[Click here to read more](https://www.positronx.io/save-user-data-in-local-storage-using-angular-7-firebase/)
Immutable Object is Useful
Tags: ruby, immutableobject, immutable, functionalobject
Published: 2018-12-28 08:44:55

---
title: Immutable Object is Useful
published: true
description: 
tags: ruby, immutableobject, immutable, functionalobject
---
From some talk videos I watched this style of code, Let's start with a simple example:

```ruby
class Fish
  def initialize(age)
    @age = age
  end
   
  def say()
    "My age is #{@age}"
  end
end

fish = Fish.new(3)
fish.say() #=> My age is 3

```

This is called immutable or functional object. It's solid and cannot be broken after created.

Then how to change the age in sample?

```ruby
class Fish
  #added
  def with_age(age)
    Fish.new(age)
  end
end

fish.with_age(5).say() #=>My age is 5
```
This code style is fun and useful. It'll reduce the change of object.

What's your idea?
Fixing hanging Gatsby 2 builds on Netlify
Tags: react, gatsby, netlify
Published: 2018-12-28 07:22:52

---
title: Fixing hanging Gatsby 2 builds on Netlify
published: true
description: Yes, caching a node version gave me headaches for weeks
tags: React, Gatsby, Netlify
---


I have been working on a music festival website as a pet project for several years now. Last year I decided to rebuild the entire thing using the [JAM Stack](https://jamstack.org/). [Contentful](https://www.contentful.com/) + [Gatsby](https://www.gatsbyjs.org/) + [Netlify](https://www.netlify.com/). It's great, fast, scalable and for my usage, completely free.

A few months ago Gatsby released their v2 and I was eager to update the website and use all the new fancy stuff. However, shortly after upgrading, when making a build via Netlify, the builds got stuck at "Cached node version vx.x.x" step, and eventually timed out.

![This was no fun](https://thepracticaldev.s3.amazonaws.com/i/779lew7lm5s4s3yyfv2z.png)

I did about 40 commits making slight changes to the code, reverting dependencies, trying different Node versions, but nothing worked. I decided to stop trying after I lost entire weekends trying to solve the issue. 

I'm one of those stubborn developers. I had to fix this myself.🤦🏻‍♂️ Meanwhile, some months had passed, and I really had to start working on the 2019 edition website. For once, I had to call in the support cavalry.

Finally I got help from Chris & Dennis from Netlify support (shout out, you made my day). They pointed me to [an issue on Github](https://github.com/gatsbyjs/gatsby/issues/7527) logged some months ago during Gatsby v2 Beta - where they address a bug, which is still in the latest version.

As it appears. The failing build is caused by a Jest worker child spawned by Gatsby during the build. But when the parent Jest worker is exited, the child keeps existing, causing the build on Netlify to time out.

## Solution

TL;DR
*Don't use setTimeout on componentWillMount.* But when you do, make sure you only execute it during runtime. (wrap it in a typeof window !== 'undefined' check)

![I know I know](https://thepracticaldev.s3.amazonaws.com/i/ygpo53660t7kg6puiywg.png)

Also. Don't use componentWillMount at all. Use hooks, like all cool kids do.😎🆒

![Hooks are so cool omgwtfbbq](https://thepracticaldev.s3.amazonaws.com/i/2kpw9ixuu7zx87paf4ap.png)

Anyway, this issue made me lose a lot of time and gave me my first grey hairs. I hope writing this will help someone in the near future.

PS: This issue also occurs when using certain firebase or aws-amplify functions in componentWillMount - as they also use setTimeouts.
Looking for Tutorial/Book recommendation for Creating graphical Web/Mobile interfaces
Tags: explainlikeimfive
Published: 2018-12-28 07:05:37

---
title: Looking for Tutorial/Book recommendation for Creating graphical Web/Mobile interfaces
published: true
tags: explainlikeimfive
---

One of my goal for 2019 is to learn front end. I've been following some tutorials and experimenting with the code part of front end development by learning React. I'd like to learn some design part too.

I've used photoshop a long time ago to create simple layouts. Is it still the preferred tool to use for designing layouts?

Does anyone have a good list of tutorials (Awesome list of design maybe?) and/or books that take you through the design phase all the way to coding? 

I'm mostly interested in Progressive Web Apps.
The truth about impostor syndrome
Tags: career, beginners, advice
Published: 2018-12-28 04:38:20

---
title: The truth about impostor syndrome
published: true
description: You're not alone - impostor syndrome is more common than you think.
tags: career, beginner, advice
cover_image: https://thepracticaldev.s3.amazonaws.com/i/cxtj2sorqw8fhxr032p7.jpg
---

_"How did I get to this point in my career? I don't belong here."_

_"Oh, it was just pure luck landing this promotion."_

_"Eventually someone is going to call me out for the fraud that I am."_

When is the last time a similar thought has crossed your mind? My guess would be at least once in the past year, maybe even the past 1-3 months. Why? Say hello to your new favorite inner enemy: impostor syndrome.

##What is impostor syndrome?

It's the shadow living in the corner of your office, judging you. Except that shadow is yourself. It's that little feeling inside of you that says you're not good enough to do what you're doing. A persistent feeling of inadequacy and insecurity, like someone's going to call you out as a fraud.

##Certainly not everyone feels this way, right? It's just me, right?

Wrong. Everyone feels like an impostor at times. Some may feel totally comfortable speaking with a group of junior devs but freeze up around their peers. Others are fine speaking with their peers, but feel they don't have the authority to speak to junior devs.

Regardless of how many years you are into your career, the feeling of inadequacy hits you out of nowhere. Nobody is immune to it. I've been coding for over 15 years now and it still strikes me, especially as I continue to grow my business. Impostor syndrome just pokes its head into new situations that I maybe didn't encounter before.

##Okay, but what can I do about it?

Create a folder on your computer. Or if you're more of the "pen and paper" type, find a physical folder. Every time you do something cool - whether it's a project you're proud of, an achievement, an award, a nice email from your boss or a colleague, save it. Put it all in that folder.

Whenever you're feeling down on yourself, go through that folder. This is work YOU did, awards YOU received, kind words sent directly your way. This is all you.

---

Whether you're just getting started in your career or you're moving on up, just remember when you start feeling that bout of impostor syndrome creeping in:

- You are here for a reason.
- You are smarter than you think you are.
- You are more capable than you think you are.
- You earned this position in your career. You worked hard to be here. You deserve it.

![You are a beautiful, talented, brilliant, powerful musk ox](https://media.giphy.com/media/kLLDVeWnNwRXO/giphy.gif)

---

##Let's hear from you.

Impostor syndrome is an ongoing battle for many -- it's very common everyone regardless of career experience. When's the last time you felt like an impostor? What methods to do you take to overcome it when it shows up in your life?
Useful article for generating SSL certs on Windows
Tags: https, local, windows, gitbash
Published: 2018-12-28 03:31:44

---
title: Useful article for generating SSL certs on Windows
published: true
description: Since this was so hard to find and understand (personally), I figured I'd share for others that may need it
tags: https,local,Windows,gitbash
cover_image: https://thepracticaldev.s3.amazonaws.com/i/5kab7tg8dzqdirtgi47l.jpeg
---

This is just an [article][1] I wanted to share that I found useful. I figured it would also be useful to others that are looking at local dev on Windows using HTTPS.

The only difference I want to mention, having followed these steps using Git Bash, is something that should be done slightly differently in Step 2 under **2 steps to issue Certificate for a local Domain**:

This step provides the following snippet:
```shell
openssl x509 \
 -req \
 -in demo.local.csr \
 -CA rootSSL.pem -CAkey rootSSL.key -CAcreateserial \
 -out demo.local.crt \
 -days 500 \
 -sha256 \
 -extfile <(echo " \
    authorityKeyIdentifier=keyid,issuer\n \
    basicConstraints=CA:FALSE\n \
    keyUsage = digitalSignature, nonRepudiation, keyEncipherment, dataEncipherment\n \
    subjectAltName=DNS:demo.local \
   ")
```

Running this using a process substitution as the argument for the `-extfile` option results in this error:
```
error loading the config file  /proc/<pid>/fd/63'
```

From what I understand, this is because a temporary directory is created in `/proc` named after the sub process's `pid`, but the sub process closes and the temporary directory is deleted before the result can be passed as an argument to the above command.

To work around this, I put the temporary config string in a file named similarly to `demo.local.cnf`, then I used that filename as the argument in place of the process substitution shown above.

### P.S.

I guarantee there are others more experienced with this; this is my first time successfully generating a cert for use locally, and I haven't had a chance to test it out yet.

Feel free to let me know where terminology and understanding needs correction/improvement. It would definitely help me better understand as I learn to work with local dev over HTTPS.

[1]: https://reactpaths.com/how-to-get-https-working-in-localhost-development-environment-f17de34af046
How to compare Go benchmark in TravisCI
Tags: go, testing, travis
Published: 2018-12-29 04:55:41

---
title: How to compare Go benchmark in TravisCI
published: true
tags: golang,testing,travis
canonical_url: https://dannypsnl.github.io//golang/testing/travis/2018/12/28/golang-benchmark-compare.html
---

Although the article is for Go, but you still can use concept part for others language.

Frist we create a script called `bench_compare.sh`:

```bash
if ["${TRAVIS_PULL_REQUEST_BRANCH:-$TRAVIS_BRANCH}" != "master"]; then
	REMOTE_URL="$(git config --get remote.origin.url)";
	cd ${TRAVIS_BUILD_DIR}/.. && \
	git clone ${REMOTE_URL} "${TRAVIS_REPO_SLUG}-bench" && \
	cd "${TRAVIS_REPO_SLUG}-bench" && \
	git checkout master && \
	go test -bench . ./... > master_bench.out && \
	git checkout ${TRAVIS_COMMIT} && \
	go test -bench . ./... > current_bench.out && \
	go get golang.org/x/tools/cmd/benchcmp && \
	benchcmp master_bench.out current_bench.out;
fi
```

Then I usually would execute it at `after_success` this section,`.travis.yml`:

```yaml
script:
  # testing part
after_success:
  # ignore
  - bash ./bench_compare.sh
```

p.s. write `script` part is just want to tell you it’s located at that indention

Now let me explain the script, basically we peek `${TRAVIS_PULL_REQUEST_BRANCH:-$TRAVIS_BRANCH}` is not `master` first. To make sure we are not at `master` branch, if we are not at `master`, then we start to compare the benchmark result. Here has a point, `$(git config --get remote.origin.url)` is required, you can write `git checkout master` to know why. Then we checkout `master` and `${TRAVIS_COMMIT}`(I think this variable already tell you what is it), do benchmarking and store them. Final step we download `golang.org/x/tools/cmd/benchcmp` for comparing, and compare two result file.

To get more info, you can reference:

- [travis default variables](https://docs.travis-ci.com/user/environment-variables/#default-environment-variables)
- [godoc.org/golang.org/x/tools/cmd/benchcmp](godoc.org/golang.org/x/tools/cmd/benchcmp)

Thanks for reading
Best-websites-a-programmer-should-visit
Tags: programmer, resource, chengefavor
Published: 2018-12-27 22:59:43

---
title: Best-websites-a-programmer-should-visit
published: true
description: 
tags: programmer, resource, chengefavor
---

{% github https://github.com/sdmg15/Best-websites-a-programmer-should-visit %}

Dev.to is on the list.

And many others.
8thlight：Tech to Watch in 2019
Tags: 2019, trend, tech
Published: 2018-12-27 22:06:25

---
title: 8thlight：Tech to Watch in 2019
published: true
description: 
tags: 2019, trend, tech
---

[-->](https://8thlight.com/blog/colin-jones/2018/12/27/tech-to-watch-in-2019.html)

![](https://8thlight.com/blog/assets/posts/2018-12-27-tech-to-watch-in-2019/tech-trends-2019-social-6f591cd11374cca1fe678bcb2389e4bdafb18428cf09472111a612058ff27932.png)

It mentioned cloud, web app, blockchain and some elixir. I'd like to try cypress, a test tool.
Limiting docker container's log size in CoreOS (running, but not limited to XenServer 7)
Tags: docker, coreos, xenserver, containermanagement
Published: 2018-12-27 21:46:59

---
title: Limiting docker container's log size in CoreOS (running, but not limited to XenServer 7)
published: true
description: A how-to on limiting the maximum logfile size of docker containers within CoreOS on XenServer
tags: docker, CoreOS, XenServer, Container Management
---

I had a problem: my gitlab docker container generated >6GiB of json-log (`/var/lib/docker/containers/<ID>/*.json`) filling up my disk. 

I'm running CoreOS within a Citrix XenServer 7 with the Container Management Supplement Pack installed.

The way of configuring the Coreos VM is via /Cloud-Config/. There are multiple ways of configuring the docker service within CoreOS to set some global logging-driver options.

CoreOS' default driver is **json-file** with no limits. (as of dec. 2018)

* Shutdown the CoreOS VM
* Within XenCenter, edit the Cloudconfig as follows:
  To set up log-file limits to e.g. Maximum 60MiB/container and 1 logfile per container, insert below the _write_files_ section:
  ```
write_files:
  - path: "/etc/docker/daemon.json"
    permissions: "0644"
    owner: "root"
    content: |
      {
        "log-driver": "json-file",
        "log-opts": {
          "max-size": "60m",
          "max-file": "1"
        }
      }
  ```
* Start the VM again

**IMPORTANT**: Changes to this global setting are **ONLY applied to newly created containers**, so you'll need to re-setup every container you want to apply the setting to. If you don't, editing the `hostconfig.json` will not help, it's getting overwritten upon container restart.

-------------------------------------------------------
Optional:

Verify file write worked:
```
cat /etc/docker/daemon.json
{
  "log-driver": "json-file",
  "log-opts": {
    "max-size": "60m",
    "max-file": "1"
  }
}
```


Verify container has applied the log settings (as root):
_/var/lib/docker/containers/<CONTAINER_ID>/hostconfig.json_
```
{"Binds":["/srv/gitlab/config:/etc/gitlab","/srv/gitlab/logs:/var/log/gitlab","/srv/gitlab/data:/var/opt/gitlab"],
"ContainerIDFile":"",
"LogConfig":{"Type":"json-file","Config":{"max-file":"1","max-size":"60m"}},
"NetworkMode":"public".....
```
See the IMPORTANT notice above, if this doesn't reflect the hostconfig you're seeing, regardig the **LogConfig** section.
NodeJS vs ASP.NET (core)
Tags: opensource, aspnetcore, node, javascript
Published: 2018-12-27 19:49:59

---
title: NodeJS vs ASP.NET (core)
cover_image: https://thepracticaldev.s3.amazonaws.com/i/yo81vg6pvyfqv77a77lf.png
published: true    
description: an open discussion about the future of the dominant open source technology
tags: open source, ASP.NET Core, NodeJS, Javascript 
---


Hello everyone,

first of all, i wish all of you a happy holiday :)


Some people claim that NodeJS is worth to learn, while others say that, 

.Net Core with web assembly will end the era of Javascript !


What do you think of the future for the dominant open source Tech ?