Blog API on Github Pages

95 minute read

We are going to see how to build an API for static websites powered by Jekyll, so you can consume static data via any web/mobile application.

We will also see how we can use the API for JSON feed.

Steps

Output data as JSON

If you just need to output some data as JSON you can easily do that using the jsonify filter.

All variables in the front matter of your site will be accessible via site variable so we took our YAML array site.whatever and convert it to JSON with the jsonify liquid filter.

Now let’s try with a more practical example. What if you want to get the JSON output of all your posts in a JSON file. That’s also not hard using Jekyll. You can do it following these two steps:

  • First create the output file with a name, let’s call it output.json.

  • Next open the output.json file and add the following code:


---
  limit: 10
---


    {
         "id": "/development/jekyll-pwa",
         "date"     : "August 06, 2019",
         "title": "Make any Jekyll site into a PWA",
         "content_html": "A Progressive Web App, or PWA, uses modern web capabilities to deliver an app-like user experience. Any website can be made into a PWA.\n\n## The basics\n\nTurning a basic website into a PWA is easy and has a lot of benefits, but first, let us know more about them in brief.\n\nAt its core Progressive Web App is just a way to optimize your website for better, faster delivery. As a developer we should learn to take advantage of these new possibilities, regardless of what our content is.\n\nMy own site is just a bunch of static HTML, and my blog is based on Jekyll, and they are still perfectly valid Progressive Web App. If you run anything on the web, you can definitely benefit from this.\n\nThe beauty is that PWAs offer the best of both worlds - deep linking and URLs from the web, offline access, push notifications and more device specific features from native apps - while still staying completely platform-independent. Just the web. If an older browser does not support it, it will not break; it just falls back to the default: a regular website. And yes there are few services out there that can make your PWA into an app, that you can just publish to the app stores.\n\nThere are some serious advantages:\n\n- A faster, more secure user experience\n- A better Google ranking\n- Better usability\n- Better performance\n- Offline access\n- Home screen shortcut like native apps\n\nEven if you don’t expect your users to “install” your PWA (e.g. place a shortcut on their home screen), there is still a lot to be gained by making the switch. In fact, all of the steps necessary to make a PWA will actively improve your website and many of them are considered as best practices.\n\n## How do I do it in Jekyll?\n\nWe will begin with the manifest and move to the JavaScript parts. Jekyll uses a build system based on partials that we will take advantage of.\n\nThe second part of the series will take a look on how we can make any static website a PWA and the third part will deal with using device specific features in a PWA.\n\nWe will partially take advantage of [PWA-Builder](https://www.pwabuilder.com) to do many things in this tutorial.\n\n## The Manifest\n\nA manifest is just a JSON file that describes all the meta data of your PWA. Things like the name, language and icon of your app go in there. This information will tell browsers how to display your app when it’s saved as a shortcut.\n\n```json\n{\n  \"lang\": \"en\",\n  \"dir\": \"ltr\\rtl\",\n  \"name\": \"This is my jekyll PWA\",\n  \"short_name\": \"myPWA\",\n  \"icons\": [\n    {\n      \"src\": \"\\/assets\\/images\\/touch\\/android-chrome-192x192.png\",\n      \"sizes\": \"192x192\",\n      \"type\": \"image\\/png\"\n    }\n  ],\n  \"theme_color\": \"#1a1a1a\",\n  \"background_color\": \"#1a1a1a\",\n  \"start_url\": \"/\",\n  \"display\": \"standalone\",\n  \"orientation\": \"natural\"\n}\n\n```\n\nThis is usually called `manifest.json` or `site.webmanifest`, and linked to from the `<head>` of your site as\n\n```html\n<link rel=\"manifest\" href=\"manifest.json\">\n\n```\n\nRegarding what fields can be there in a manifest file see [MDN](https://developer.mozilla.org/en-US/docs/Web/Manifest).\n\nFor Jekyll we will do few changes to `manifest.json` so that we can make changes directly from `_config.yml` and prevent jekyll to render it using default layout (which might insert the json into html for some themes).\n\nThe `<head>` portion will come in the `partial` that builds the head of every page. Usually it would be located in `_partials`.\n\n```json\n\n---\nlayout: none\n\n---\n\n{\n  \"lang\": \"{{ site.language }}\",\n  \"dir\": \"{{ site.lang_direction }}\",\n  \"name\": {{ site.name | smartify | jsonify }},\n  \"short_name\": {{ site.short_name | smartify | jsonify }},\n  \"icons\": [\n    {\n      \"src\": \"\\/assets\\/images\\/touch\\/android-chrome-192x192.png\",\n      \"sizes\": \"192x192\",\n      \"type\": \"image\\/png\"\n    }\n  ],\n  \"theme_color\": \"{{ site.color }}\",\n  \"background_color\": \"{{ site.color }}\",\n  \"start_url\": \"{{ site.url }}\",\n  \"display\": \"standalone\",\n  \"orientation\": \"natural\"\n}\n\n```\n\nAnd in the `_config.yml` we might already have these following fields, if not we can always add it there.😅\n\n```yaml\n\nname: \"mysite\"\nshort_name: \"ms\"\nurl: \"https://mysite.com\"\nlanguage: \"en\"\nlang_direction: \"ltr\"\ncolor: \"#abc123\"\n\n```\n\nSo your manifest is set up. Now we move to next part.\n\n## Register the service worker\n\nNow we need to add the JavaScript that registers the service worker into the `partial` that forms the `<head>` of your every page. As before it would usually  be located in `_partials`.\n\nWe need to add the following piece of JavaScript in `<script>` tag.\n\n```js\n\nif (\"serviceWorker\" in navigator) {\n  if (navigator.serviceWorker.controller) {\n    console.log(\"An active service worker found, no need to register\");\n  } else {\n    // Register the service worker\n    navigator.serviceWorker\n      .register(\"{{ site.baseurl }}/serviceworker.js\", {\n        scope: \"./\"\n      })\n      .then(function (reg) {\n        console.log(\"Service worker has been registered for scope: \" + reg.scope);\n      });\n  }\n}\n\n```\n\n## Service Worker\n\nNow we move to the next step. We need to create the `serviceworker.js` at the root of your site.\n\nIt will have the following JavaScript:\n\n```js\n\nconst CACHE = \"pwabuilder-offline\";\n\nconst offlineFallbackPage = \"index.html\";\n\n// Install stage sets up the index page (home page) in the cache and opens a new cache\nself.addEventListener(\"install\", function (event) {\n  console.log(\"Install Event processing\");\n\n  event.waitUntil(\n    caches.open(CACHE).then(function (cache) {\n      console.log(\"Cached offline page during install\");\n\n      if (offlineFallbackPage === \"ToDo-replace-this-name.html\") {\n        return cache.add(new Response(\"Update the value of the offlineFallbackPage constant in the serviceworker.\"));\n      }\n      \n      return cache.add(offlineFallbackPage);\n    })\n  );\n});\n\n// If any fetch fails, it will look for the request in the cache and serve it from there first\nself.addEventListener(\"fetch\", function (event) {\n  if (event.request.method !== \"GET\") return;\n\n  event.respondWith(\n    fetch(event.request)\n      .then(function (response) {\n        console.log(\"Add page to offline cache: \" + response.url);\n\n        // If request was success, add or update it in the cache\n        event.waitUntil(updateCache(event.request, response.clone()));\n\n        return response;\n      })\n      .catch(function (error) {        \n        console.log(\"Network request Failed. Serving content from cache: \" + error);\n        return fromCache(event.request);\n      })\n  );\n});\n\nfunction fromCache(request) {\n  // Check to see if you have it in the cache\n  // Return response\n  // If not in the cache, then return error page\n  return caches.open(CACHE).then(function (cache) {\n    return cache.match(request).then(function (matching) {\n      if (!matching || matching.status === 404) {\n        return Promise.reject(\"no-match\");\n      }\n\n      return matching;\n    });\n  });\n}\n\nfunction updateCache(request, response) {\n  return caches.open(CACHE).then(function (cache) {\n    return cache.put(request, response);\n  });\n}\n\n```\n\nNow you're all done with the JavaScript part.\n\n## Looking forward\n\nPush these changes to your Jekyll site and voila! It is now a PWA.😁\n\nI intentionally missed the part where we map the icons to the config to keep things simple, if you need help with that, drop me a comment below and I'll show you how.\n\nAlso HTTPS is essential for the site to be a PWA. Most likely you might already have heard of it and maybe using it, so I didn't stress on it.\n\n[OPTIONAL] You can check the status of your PWA by Lighthouse Audit.😄\n\n## Make your app\n\nYes!\n\nIf you have reached so far why not go a step further?\n\nIf you want you can build your apps to be uploaded to Microsoft Store, Play Store and App Store via [PWA-Builder](https://www.pwabuilder.com).\n\nFirst you'll have to enter the url of your site and click enter. It will rate your PWA out of 100. If you followed this guide you'll get 95. Not bad. 😅\n\nYou will see a bright purple button on top right, a page will come with instructions to download the apps and proceed further. If you need help, you can always drop a comment below.😀\n\n\n##### Until next time!\n\nCheers!🍻",
         "url": "https://blog.alokprateek.in/development/jekyll-pwa/",
         "summary": "",
         "date_published": "2019-08-06 00:00:00 +0530",
          "categories"  : [
                 "development"
                
                
                ],
         
         
          "tags"  : [
                
                ]
         
         
    },

    {
         "id": "/development/aws-terms",
         "date"     : "July 19, 2019",
         "title": "AWS Terms",
         "content_html": "There are many terms in AWS that use confusing names for simple things.\nEven working with AWS for over a year, I really miss out on some terms. That's why I wrote this article. Typing whatever I remember. I am studying these for my AWS exam, which I will take in a few weeks! \n\nSo here are the terms:\n\n## Terms\n\n1. **Access control list (ACL)**: A firewall/security layer on the subnet level\n2. **Auto scaling**: Automates the process of adding or removing EC2 instances based on traffic demand for your application\n3. **Buckets**: Root-level “folders”\n4. **CloudFront**: Content delivery network (CDN) that allows you to store your content at “edge locations” located all around the world, allowing customers to access your content more quickly\n5. **CloudTrail**: Allows you to monitor all actions taken by IAM users\n6. **CloudWatch**: Service that allows you to monitor various elements of your AWS account\n7. **Consolidated billing**: Allows you to view, manage, and pay bills for multiple AWS accounts in one user interface\n8. **DNS server**: A database of website domains and their corresponding IP addresses\n9. **DynamoDB**: NoSQL database service that does not provide other NoSQL software options\n10. **Elastic Compute Cloud (EC2)**: A virtual computer, very similar to a desktop/laptop computer\n11. **Elastic Load Balancing (ELB)**: Evenly distributes traffic between EC2 instances that are associated with it\n12. **ElastiCache**: Data caching service used to help improve the speed/performance of web applications running on AWS\n13. **Elasticity**: The ability of a system to increase and decrease in size\n14. **Fault tolerance**: Property that enables a system to continue operating properly in the event of the failure of one or more components\n15. **Firewall**: A type of software that either allows or blocks certain kinds of internet traffic to pass through it\n16. **Folder**: Any “subfolder” created in a bucket\n17. **High availability**: Refers to systems that are durable and likely to operate continuously without failure for a long time\n18. **IAM users**: Individuals who have been granted access to an AWS account\n19. **Identity and Access Management (IAM)**: Service where AWS user accounts and their access to various AWS services are managed\n20. **Lambda**: Serverless computing that will replace EC2 instances, for the most part\n21. **Object availability**: Percent over a one-year time period that a file stored in S3 will be accessible\n22. **Object durability**: Percent over a one-year time period that a file stored in S3 will not be lost\n23. **Object lifecycle**: Set rules to automatically transfer objects between storage classes at defined time intervals\n24. **Object sharing**: Ability to make any object publicly available via a URL link\n25. **Object versioning**: Automatically keep multiple versions of an object (when enabled)\n26. **Organizations**: Allow you or your company access to manage billing and access to multiple AWS accounts in one user interface\n27. **Principle of least privilege**: Giving a user only the rights/access to the AWS services and resources they need to do their job and nothing more\n28. **Publishers**: Human/alarm/event that gives SNS the message that needs to be sent\n29. **Relational Database Service (RDS)**: SQL database service that provides a wide range of SQL database options to select from\n30. **RedShift**: Data warehouse database service designed to handle petabytes of data for analysis\n31. **Roles**: How different AWS services are granted permission to communicate and share data\n32. **Route 53**: Where you configure and manage web domains for websites or applications you host on AWS\n33. **Scalability**: The ability of a system to easily increase in size and capacity in a cost-effective way\n34. **Security group (SG)**: Firewall/security layer on the server/instance level\n35. **Shared responsibility model**: Defines what you and AWS are responsible for when it comes to security and compliance\n36. **Simple Notification Service (SNS)**: AWS service that allows you to automate the sending of email or text messaging notifications based on events that happen in your AWS account\n37. **Simple Storage Service (S3)**: Online bulk storage service you can access from almost any device\n38. **Storage class**: Represents “classification” assigned to each object in S3 (standard, RRS, S3-IA, Glacier)\n39. **Subnet**: A subsection of a network and generally includes all the computers in a specific location\n40. **Subscriptions**: Endpoints to which a topic sends messages\n41. **Topics**: How you label and group different endpoints to which you send messages\n42. **Trusted Advisor**: Service that “advises” and helps you optimize aspects of your AWS account\n43. **User credentials**: IAM user’s username and password for logging in to AWS\n44. **Virtual Private Cloud (VPC)**: A private subsection of AWS you control and in which you can place AWS resources\n\n**Do tell me what I've missed! It will help both me and the community. :-) **",
         "url": "https://blog.alokprateek.in/development/aws-terms/",
         "summary": "",
         "date_published": "2019-07-19 00:00:00 +0530",
          "categories"  : [
                 "development"
                
                
                ],
         
         
          "tags"  : [
                
                ]
         
         
    },

    {
         "id": "/development/web-accessibility",
         "date"     : "July 16, 2019",
         "title": "Introduction To Accessibility",
         "content_html": "Accessibility is a term you keep hearing, but may not fully understand. This is in part because the word itself can be a bit confusing. The root word, access, makes the concept seem tied to things like passwords. If users can “access” your site, accessibility is checked off. If only it were that simple.\n\nWeb accessibility is really about a user’s ability to access your site’s content, regardless of any physical or mental impairments. The inventor of the internet, **Sir Tim Berners-Lee**, put it perfectly:\n\n> “The power of the Web is in its universality. Access by everyone regardless of disability is an essential aspect.”\n\nA truly accessible website is inclusive of every potential user. It covers differential abilities of all shapes, sizes, and permanence. Users who are blind have their own needs, as do users with a broken hand. There’s also overlap among accessibility groups. Users experiencing concussion symptoms can benefit from features designed to make a piece of content more accessible for users who experience seizures. Accessibility is a multi-faceted topic.\n\nThere are six basics principles that make web better for everyone!\n\n## Have correct text size\n\nUsers of the Internet have varying eye sight levels (due to injury, disease or age factor) and it's important to have a decent font size so that everyone can read your website without strain.\n\nBrowsers come at with a default font size of `16px`. We should try to not go below that at least. Take `16px` as your smallest base and build your text hierarchy upwards.\n\nAt the very minimum set your font sizes in em unit so that users can zoom in your website to increase font sizes.\n\n> Except for captions and images of text, text can be resized without assistive technology up to 200 percent without loss of content or functionality.\n> - w3.org\n\n## Better Color Contrast\n\nUsers of the Internet have varying eye sight levels and it's important to have a good contrast so that everyone can read your websites without strain. My dad has deuteranopia. He can't see all colors as I do, which i discovered when I was in middle school. These days I use a plugin that checks for color issues. More on that later.\n\nThis is why there is a recommended guideline just to prevent this issue. It requires that,\n\n> The visual presentation of text and images of text has a contrast ratio of at least 4.5:1.\n> - w3.org\n\n## Make text content easy to read and understandable\n\nSome sentences are just highly compounded and complex that require the reader to put in extra mental focus to figure out the overall meaning of the sentence. It might still be understandable by many people. But there are people with disabilities, including reading disabilities, even among highly educated users with specialized knowledge of the subject matter. It may be possible to accommodate these users by making the text more readable.\n\nHere is the required guideline:\n\n> When text requires reading ability more advanced than the lower secondary education level after removal of proper names and titles, supplemental content, or a version that does not require reading ability more advanced than the lower secondary education level, is available.\n> - w3.org\n\nIn short,\n\n- Avoid difficult and less common words\n- Write short sentences\n- Don't use more than two conjunctions in a sentence\n- Bullet points help wherever applicable\n\n## Labelled Form Controls\n\nYes, we know that once a while we see a checkbox that is too small to be clicked. A normal size checkbox could have been just fine for you to click easily. But important thing to understand here is that even the normal size checkbox can be difficult to click for some people. Specially the ones with weak motor skills i.e. Ability to do a pre-determined movement with maximum certainty.\n\nThis is one of the reasons why there is a recommended guideline to associate a `<label>` element with the `<input>` element (with all form controls in general). This makes the label also a clickable part of the form control. So you don't have to pin-point the form control.\n\n> Present instructions or labels that identify the controls in a form so that users know what input data is expected.\n> - w3.org\n\nAgain, note that this is just one of the reasons why form controls should be correctly labelled. There are more benefits to it, Which I will come to in the next part\n\n## Labels or Instructions\n\nUnfortunately, the developer decided to put it as the placeholder of the input. Placeholders vanish as soon as any text is entered in the input field.\n\nWhat's wrong in it? Nowadays many input fields in the forms are auto-filled by browsers for us. In such a situation, if the user wants to cross-check the filled values if they are appropriate, they have no way to know what's really asked in a particular input field! The same issue also applies to a user with short memory who started filling the form and then wants to verify the fields mid-way. So always label your input fields such that the label/instruction is accessible to the user at all times.\n\n> Present instructions or labels that identify the controls in a form so that users know what input data is expected.\n> - w3.org\n\n## Adjustable Timings\n\n>Ensure that users with disabilities are given adequate time to interact with Web content whenever possible. People with disabilities such as blindness, low vision, dexterity impairments, and cognitive limitations may require more time to read content or to perform functions such as filling out on-line forms.\n> - w3.org\n\nWebsites are filled with things like alerts, notification etc that show for a short duration and then go away. Here are few things you can do to make them more accessible:\n\n- Make them stay longer.\n- Show how much time is left before they go away.\n- Pause their timer when hovered or focused.\n\nIn the past few points, you went through some examples of web content. The motive of those examples was two-fold:\n\n- To display few ways in which websites are generally found inaccessible.\n- To bring forth the fact that what you find okay for yourself, can be inaccessible for someone else. So the best we can do to make our websites accessible to most people is - Follow the recommended guidelines.\nHope it was a learning experience for you. If it was, please pass this on to every other developer, designer, marketer, any you know who works with websites.\n\nLet's make the Web a better place!\n\nDid I miss something? or You can share some more better tips?\nPlease leave your views in comments!\n",
         "url": "https://blog.alokprateek.in/development/web-accessibility/",
         "summary": "",
         "date_published": "2019-07-16 00:00:00 +0530",
          "categories"  : [
                 "development"
                
                
                ],
         
         
          "tags"  : [
                
                ]
         
         
    },

    {
         "id": "/development/jekyll-api-gh-pages-and-json-feed",
         "date"     : "July 14, 2019",
         "title": "Blog API on Github Pages",
         "content_html": "We are going to see how to build an API for static websites powered by Jekyll, so you can consume static data via any web/mobile application.\n\nWe will also see how we can use the API for JSON feed.\n\n## Steps\n\n### Output data as JSON\n\nIf you just need to output some data as JSON you can easily do that using the `jsonify` filter.\n\nAll variables in the front matter of your site will be accessible via site variable so we took our YAML array `site.whatever` and convert it to JSON with the `jsonify` liquid filter.\n\nNow let's try with a more practical example. What if you want to get the JSON output of all your posts in a JSON file. That's also not hard using Jekyll. You can do it following these two steps:\n\n- First create the output file with a name, let's call it `output.json`.\n\n- Next open the `output.json` file and add the following code:\n\n```liquid\n\n---\n  limit: 10\n---\n\n{% for post in site.posts limit: page.limit %}\n    {\n         \"id\": \"{{ post.id }}\",\n         \"date\"     : \"{{ post.date | date: \"%B %d, %Y\" }}\",\n         \"title\": {{ post.title | smartify | jsonify }},\n         \"content_html\": {{ post.content | jsonify }},\n         \"url\": \"{{ site.url }}{{ post.url }}\",\n         \"summary\": {% if post.url contains \"/blog/\" %}{{ post.excerpt | smartify | jsonify }}{% else %}{{ post.description | smartify | jsonify }}{% endif %},\n         \"date_published\": \"{{ post.date }}\",\n         {% if post.categories %} \"categories\"  : [\n                {% for category in post.categories %} \"{{ category }}\"\n                {% if forloop.last %}{% else %},{% endif %}\n                {% endfor %}\n                ],\n         {% endif %}\n         {% if post.categories == nil %} \"categories\"  : [],  {% endif %}\n         {% if post.tags %} \"tags\"  : [\n                {% for tag in post.tags %} \"{{ tag }}\"\n                {% if forloop.last %}{% else %},{% endif %}\n                {% endfor %}\n                ]\n         {% endif %}\n         {% if post.tags == nil %} \"tags\"  : []  {% endif %}\n    }{% unless forloop.last == true %},{% endunless %}\n{% endfor %}\n\n\n```\n\nWe have looped through all `site.posts` and created a JSON object with each post data separating the objects with a comma. After building your website, Jekyll will take care of parsing the YAML and Liquid data and outputting `output.json` with your posts data in the JSON format.\n\nGo ahead and test it with a Jekyll blog, serve it or build it then look inside of your `_site` folder for your `output.json` with posts data. Or just visit `127.0.0.1:4000/output.json` to see the result.\n\nIf you use use github pages go to your blog link `/output.json` and see the result.\n\nThe `limit` meta in the front matter controls the number of posts to output as `JSON`.\n\n### Using the output as API\n\nIt's simple! Place the `output.json` under a new folder called `api` and rename it `index.json`.\n\n### Making this API as JSON feed\n\nI read about the [JSON feed spec](https://jsonfeed.org/version/1), and I was intrigued by the novelty of it — not the ease of using JSON as much as the insurmountable pain of using Atom XML.\n\nFor most developers, JSON is far easier to read and write than XML. Developers may groan at picking up an XML parser, but decoding JSON is often just a single line of code.\n\nSince I already been using Jekyll for my blog, writing the code would need to be done in Liquid without any plugins.\n\nAlso in the example we already have a API ready, Why not use it?\n\n```liquid\n\n---\nlayout: none\n---\n{\n    \"\"version\": \"https://jsonfeed.org/version/1\",\n    \"title\": {{ site.name | smartify | jsonify }},\n    {% if site.description %}\"description\": {{ site.description | smartify | jsonify }},{% endif %}\n    \"home_page_url\": \"{{ site.url }}/\",\n    \"feed_url\": \"{{ site.url }}/api/index.json\",\n    \"icon\": \"{{ site.url }}/assets/favicon/android-chrome-192x192.png\",\n    \"favicon\": \"{{ site.url }}/favicon.ico\",\n    \"author\": {\n        \"name\": \"{{ site.author }}\",\n        \"url\": \"https://alokprateek.in/\",\n        \"avatar\": \"https://alokprateek.in/avatar3.jpg\"\n    },\n    \"expired\": false,\n    \"items\": [\n           ]\n}\n\n```\n\nUnder `items` whatever existed in `index.json` before goes in, without the front matter, that remains the same.\n\nFields like `icon`, `favicon`, and `author` depend on your particular implementation, and I didn’t feel like generalizing the code by using front-matter variables rather I just pasted the values directly.\n\nSecond, you’ll have to read the spec for the full info on which fields are optional and mandatory.\n\nThat’s about it! 😊\n\nFor a final example take a look at my final JSON. And you can curl at this link [blog.alokprateek.in/api/](https://blog.alokprateek.in/api/)\n\n```liquid\n\n---\nlimit: 10\nlayout: none\n---\n{\n    \"version\": \"https://jsonfeed.org/version/1\",\n    \"title\": {{ site.name | smartify | jsonify }},\n    {% if site.description %}\"description\": {{ site.description | smartify | jsonify }},{% endif %}\n    \"home_page_url\": \"{{ site.url }}/\",\n    \"feed_url\": \"{{ site.url }}/api/index.json\",\n    \"icon\": \"{{ site.url }}/assets/favicon/android-chrome-192x192.png\",\n    \"favicon\": \"{{ site.url }}/favicon.ico\",\n    \"author\": {\n        \"name\": \"{{ site.author }}\",\n        \"url\": \"https://alokprateek.in/\",\n        \"avatar\": \"https://alokprateek.in/avatar3.jpg\"\n    },\n    \"expired\": false,\n    \"items\": [\n{% for post in site.posts limit: page.limit %}\n    {\n      \"title\": \"{{ post.title }}\",\n      \"date\"     : \"{{ post.date | date: \"%B %d, %Y\" }}\",\n      \"url\": \"{{ site.url }}{{ post.url }}\",\n      \"summary\": {{ post.excerpt | smartify | jsonify }},\n      \"content_html\": {{ post.content | jsonify }},\n      {% if post.categories %} \"categories\"  : [\n        {% for category in post.categories %} \"{{ category }}\"\n        {% if forloop.last %}{% else %},{% endif %}\n        {% endfor %}\n        ],\n      {% endif %}\n      {% if post.categories == nil %} \"categories\"  : [],  {% endif %}\n      {% if post.tags %} \"tags\"  : [\n        {% for tag in post.tags %} \"{{ tag }}\"\n        {% if forloop.last %}{% else %},{% endif %}\n        {% endfor %}\n        ]\n      {% endif %}\n      {% if post.tags == nil %} \"tags\"  : []  {% endif %}\n\n    }\n    {% unless forloop.last %},{% endunless %}\n{% endfor %}\n    ]\n}\n\n```\n\nUntil next time!\n\nCheers!🍻\n",
         "url": "https://blog.alokprateek.in/development/jekyll-api-gh-pages-and-json-feed/",
         "summary": "",
         "date_published": "2019-07-14 00:00:00 +0530",
          "categories"  : [
                 "development"
                
                
                ],
         
         
          "tags"  : [
                
                ]
         
         
    },

    {
         "id": "/random/color-purple",
         "date"     : "October 17, 2016",
         "title": "Plot Summary",
         "content_html": "<p>A book review of The Color Purple by Alice Walker.</p>\n\n<h2 id=\"first-period\">First Period</h2>\n\n<p>In The Color Purple, the story is told through letters. The only sentences outside the letters are the first two: “You better not never tell nobody but God. It’d kill your mammy.” Silenced forever, the main character, fourteen year old Celie, writes letters to God. Her father has raped her, and she has two children, a girl and a boy, whom “Pa” took away from her. Celie’s mother has died and Pa is looking too much at her little sister, Nettie.\nMr. wants to marry Nettie but Pa rejects him because of the Mr.’s scandals with Shug Avery, a blues singer. Celie manages to get a picture of Shug and falls in love with her. Eventually, Mr. agrees to take Celie instead of Nettie because Pa offers him a cow.\nOnce she is in his care, Mr. beats Celie all the time. Meanwhile, Nettie runs away from Pa and comes to Mr.’s house, but when she rejects him, he throws her out. Celie advises Nettie to ask her daughter Olivia’s new “mother” for help. Nettie promises to write but her letters never arrive.\nOne day, Shug Avery comes to town, but Mr. does not take Celie to see her. Harpo, Mr.’s son, gets married to Sofia, a strong brave woman, and when he complains that Sofia does not obey him, Celie advises Harpo to beat her. Sofia finds out, and in the conversation that follows, Celie realizes she is jealous of Sofia: “You do what I can’t. Fight,” she says.</p>\n\n<h2 id=\"second-period\">Second Period</h2>\n\n<p>Shug is ill and Mr. brings her to his home. To Celie’s surprise, she calls Mr. by his first name, Albert. Celie’s love and care make Shug better; Shug starts composing a new song.\nSofia finally leaves Harpo, who turns his house into a jukejoint and asks Shug to sing. Shug invites Celie to the performance. Shug sings “A Good Man Is Hard to Find” and then her new piece, called “Celie’s Song.” Celie discovers that she is important to someone.\nBefore leaving, Shug says she will make sure Mr. never beats Celie again. She also teaches Celie to love herself. By the time Sofia returns with a new man and six children instead of five, Harpo has a little girlfriend he calls Squeak. Sofia and Squeak hit each other in the jukejoint, and finally Sofia leaves.\nThe mayor’s wife sees Sofia in town with the kids and asks Sofia to be her maid. Sofia answers “Hell no,” and hits the mayor when he protests. She is arrested, beaten and left in prison. Meanwhile, Squeak takes care of Sofia’s children. When she finds out one of Sofia’s wardens is her uncle, Squeak tries to save Sofia. She convinces the warden that working for the mayor’s wife would be a better punishment for Sofia. The warden forces Squeak to have sexual intercourse with him. When Squeak goes back home, furious and humiliated, she orders Harpo to call her Mary Agnes, her real name. Sofia starts working for the mayor’s wife, but she is treated as a slave.\nOn her next visit, Shug is married. She and Celie have missed each other, and one night, when the men are away, Celie tells Shug the story of Pa and the children. Shug kisses her, and they make love.</p>\n\n<h2 id=\"third-period\">Third Period</h2>\n\n<p>One day, Shug asks Celie about Nettie, and together they realize Mr. has been hiding Nettie’s letters. They finally recover them from Mr.’s trunk.\nUnlike Celie’s letters to God, Nettie’s letters are written in standard English. The day Nettie left, Mr. followed her and tried to rape her. She fought, and he had to give up, but he promised she would never hear from Celie again. Nettie went to see Corrine, Olivia’s new mother, and her husband, the Reverend Samuel. She also met Celie’s other child, Adam. Samuel was a member of a missionary society, and Nettie decided to go to Africa with the family. First, they went to New York, where Nettie discovered Harlem and African culture. Then, they went to England and Senegal, where Nettie saw what Europe was doing to Africa: robbing its treasures, using its peoples, and impoverishing the land.\nCelie reads Nettie’s letters and wants to kill Mr. for having hidden them. To help Celie control herself, Shug suggests that Celie make herself a pair of pants and go on reading the letters.\nWhen the missionary group arrived in Africa, the Olinkas thought Adam and Olivia were Nettie’s and Samuel’s children. They told Nettie the story about roofleaves: There had been a greedy chief who cut down much of the jungle in order to create more farmland. The plants, which provided the leaves for the roofs of the Olinkas’ houses, were destroyed, and many people died. The village began worshipping the leaves. When Nettie looked at the roof of her new house in the village, she knew she was in front of the Olinkas’ God.\nOlinka girls were not educated. Olivia was the only girl at school. Corrine, jealous and worried by the Olinkas’ impressions about her family, asked Nettie to tell the children not to call her Mama. Olivia’s only girlfriend, Tashi, could not come to school because her parents forbade it.\nAfter five years of silence, the next letter tells Celie that Adam and Olivia had discovered connections between slave stories and African stories. Tashi’s father had died, and her mother had let her go to school. A road was now near the village, and suddenly the Olinkas realized it was going to destroy their sacred place. The chief went to the coast to do something about it, but he discovered that the Olinkas’ whole territory now belonged to a rubber company.\nWhen Corrine got ill shortly afterwards, she told Nettie she thought Adam and Olivia were Nettie’s and Samuel’s kids. Though Nettie swore it was not so, Corrine was not convinced. Nettie and Samuel talked about it, and Samuel told her that Celie’s and Nettie’s real father was not the man they called “Pa”; their mother had been married before to a man who was lynched by white people. In this way, Celie is freed from the nightmare of believing her children are also her brother and sister.</p>\n\n<h2 id=\"fourth-period\">Fourth Period</h2>\n\n<p>For the first time, Celie writes a letter to Nettie. She has visited her old house with Shug and seen her Pa. Meanwhile, she goes on reading Nettie’s letters.\nNettie and Samuel tried to convince Corrine of the real story of the children. She believed them only when Nettie made her remember meeting Celie in town. Corrine smiled to them then but died soon afterwards.\n“I don’t write to God no more, I write to you (Nettie)”, says Celie in her next letter. She sees she has been praying to a white old man. Shug tells Celie she believes God is not a He or a She, but an It. It is everything, and It gets very angry if one walks by the color purple in a field and doesn’t notice it.\nShug and Celie decide to leave Mr. together with Mary Agnes, who wants to be a singer. Celie curses Mr. and tells him that everything he did to her, he did to himself. The two women go to Shug’s house in Memphis. Then, Shug travels around singing, and Celie starts Folkspants, Unlimited, a family clothing business.\nWhen Celie goes back home to see Sofia and Harpo, she finds Mr. has changed. He cooks and cleans. Now they can talk. Harpo tells Celie his father could not sleep until he sent Celie the last letters he had kept.\nThe letters say Nettie and Samuel got married in the middle of the Olinka war. The company destroyed the roofleaves. Some of the Olinkas went to the jungle to search for the mbeles, a legendary tribe. Samuel and Nettie traveled to England and in the journey, Nettie told the children their real story. They were eager to meet Celie, but Adam missed Tashi. When they got back to Africa, the Olinkas were so desperate that they had marked their children’s faces to keep their tradition alive. Tashi had the traditional scars in her cheeks.\nIn America, Celie’s stepfather dies and she inherits the house. She cleans it of its horror with a ceremony and sells her pants there. Shug goes back to Memphis. Celie is very sad and lonely, and she then hears that the ship Nettie had taken to go home was sunk by the Germans.\nBut Nettie’s letters keep arriving. Tashi, her mother, and Adam all disappeared from the village. Meanwhile, Mr. and Celie are united through heartbreak and their love for Shug. Celie discovers that Mr. loves to sew. While they work together, she tells him the Olinkas’ version of Adam and Eve’s story: Adam and Eve were the first white babies in a black world, rejected because they were different. The serpent represents black people. Whites crush this serpent when they can because they are still enraged. In time, white people will be the new serpent and colored people will crush them. The only way to stop this horror is to worship the serpent and accept that it is our relative.\nIn her last letter, Nettie tells Celie that Adam and Tashi went to a secret valley where people from different tribes lived together. When they came back, Adam wanted to marry Tashi, but she rejected him. Adam scarred himself to convince her, and then they got married.\nSofia starts working in Celie’s store. She is with Harpo again. Mr., who is now called Albert, asks Celie to marry him, but Celie prefers friendship. Shug comes back to them. Celie’s last letter in the book is to God, but this time it is Shug’s God. Celie is happy: Nettie, Samuel and the children are home at last.</p>\n\n<h1 id=\"themes\">THEMES</h1>\n\n<h2 id=\"sexism\">Sexism</h2>\n<p>Sexual relations between men and women in The Color Purple is a major theme. Alice Walker sets her story of Celie’s transformation from a passive female to an independent woman within the culture of southern black rural society from the 1920s to the 1940s. In the beginning of the story, Celie is dominated first by her father, whom she later learns is really her stepfather, then by her husband, Albert (Mr.). The catalyst for the character change in Celie is the relationship she develops with Shug Avery, her husband Albert’s mistress. Because Celie has been warned by her stepfather, Alphonso, not to tell anyone but God about how he repeatedly rapes her, she begins to write letters to God. It is through the letters that the reader develops a sense of Celie’s being, which at first is self-effacing, but eventually becomes strong and independent.\nIn the novel there are a number of role reversals that take place between men and women. Harpo, Albert’s son, tries to emulate his father and attempts to dominate his strong-willed wife, Sofia. By the end of the story, Harpo and Sofia have reversed traditional male-female roles. Harpo stays home to take care of the house, while Sofia works. Celie and Albert also reverse roles. By the end of the story, Celie is an independent businesswoman, and Albert is her assistant. Celie has also learned to speak up for herself, claiming her house when her stepfather dies. The sexual relationship between Celie and Shug further breaks with the traditional roles of passive women and dominant men that the story challenges. In the relationship between Samuel and Corrine, the missionaries who adopt Celie’s children, and later between Nettie and Samuel, Walker presents what could be called a partnership relationship between a man and woman. In these relationships, both the man and the woman share the same goals and work together to realize them. Walker uses the incident between Squeak and her white uncle, the warden at Sofia’s prison, to illustrate how sexism and racism were expressed. The warden has no qualms about raping his own niece, which reflects a southern, white, male disregard for the dignity of black women. During the period of the novel, it was a commonly held view among white males that they could do whatever they pleased with black women, a view that many black males shared as well.</p>\n\n<h2 id=\"transformation\">Transformation</h2>\n<p>Celie’s transformation from a young passive girl, who is the object of violence and cruelty from her stepfather and her husband, into an independent woman with self-esteem is at the heart of The Color Purple. While the ways in which conflicts are resolved may stretch the imagination at times, they are central to the author’s view that goodness can triumph over evil. That Celie is able to forgive Albert by the end of the story and take him in as a helper reflects Walker’s insistence on the redeeming quality of the human heart. She shows in transformed relationships that the worst cruelty committed by one person on another does not prohibit a change of heart. Her view is basically that the conditions under which human beings struggle shape their behavior. Albert had a difficult life and took out his frustrations on Celie. When Celie became self-sufficient, she could easily have turned her back on Albert, but it is not within the framework of her character to be uncharitable. In becoming independent, Celie has found happiness. Rejecting Albert would detract from her happiness. Celie’s behavior toward Albert reflects Walker’s insistence on forgiveness and contributes to the overall religious overtones of the book.</p>\n\n<h2 id=\"culture\">Culture</h2>\n<p>Cultural difference plays a significant role in The Color Purple. Walker effectively uses black folk English in Celie’s letters to express the voice of poor, black rural African Americans. Walker presents a clear picture in the book of the economic and social hardships that African Americans faced in the rural south during the early 1900s. She also presents an honest picture of the effects of racial repression. The picture Walker paints of black life is not one-sided. While Celie and Albert are tied to the land and the harsh life it represents, Nettie escapes into a black middle-class life through her missionary friends. Religion in the South played an important role in liberating many African Americans from poverty. As a spin-off for involvement with the church, literacy and education flourished. Celie is embracing a religious literacy through her letters to God, and in her letters to Nettie she comes to grips with the larger world, including Africa, outside her small community. By making the connection to Africa, Walker emphasizes the importance of African Americans’ roots.</p>\n\n<h1 id=\"construction\">CONSTRUCTION</h1>\n\n<h2 id=\"point-of-view\">Point of View</h2>\n<p>The Color Purple is written in the first person, and the voice is predominately Celie’s, but some of the letters that comprise the book are written to Celie by her sister Nettie. The story covers thirty years of Celie’s life from childhood to her maturity as an independent woman. By having Celie write in black folk English, Walker brings the reader close to the quality and rhythms of life that her characters experience. Celie’s dialect also reflects her lack of formal education. Nettie, who was formally educated, writes her letters in standard English. They are full of information that becomes a source of knowledge for Celie outside the world of her own small community.</p>\n\n<h2 id=\"structure\">Structure</h2>\n<p>The structure of The Color Purple is the series of letters Celie writes to God and to her sister Nettie. Some of the letters in the book are written by Nettie to Celie. This literary form is called the epistolary novel, a form developed in eighteenth-century England by novelists like Samuel Richardson. A major advantage of this structure is that the reader becomes intimate with the character of the letter writer. With the epistolary form, Walker was able to focus on the inner life of her main character and create a sense of intimacy that may be partly responsible for the success of the book. This technique creates a confidential reading experience. The reader has a chance to read over the character’s shoulder and look inside her. Nettie, to a great extent, escaped the cruelty that Celie experienced because she was able to leave home early. The tone of her letters to Celie contrasts sharply with Celie’s letters to God. In Nettie’s letters, there is much less intimacy. They do not contain the suffering that Celie has expressed in her letters to God. By introducing Nettie’s letters, Walker is able to shift her story from Celie’s life of despair to a life that begins to have hope. It is through the help of Shug Avery that Celie finds her hope—the letters from Nettie that Albert had hidden from her.\nBasically there are four time frames of the novel. In the first period of her life, Celie experiences the misery of poverty and cruelty at the hands of her stepfather. In the second closely-related period, Celie experiences continued cruelty from her husband Albert. In the third period, she awakens to the possibility of self-realization through her relationship with Shug and her renewed contact with her sister Nettie. Finally, Celie has realized herself and has established a life where she has control; she has found the happiness and contentment that come from self-realization. Another period, not directly a part of Celie’s life, is Nettie’s time spent in Africa. The letters from Nettie serve as a contrast to Celie’s life. They also enlarge Celie’s perspective and help to universalize her life.</p>\n\n<h2 id=\"symbolism\">Symbolism</h2>\n<p>The primary symbol of The Color Purple is found in the title, The Color Purple. The significance of the color purple is that it stands for human hope. It is a miraculous color when found in nature, and one which indicates that the feeling of hope, despite misery is a miracle of the human spirit.</p>\n",
         "url": "https://blog.alokprateek.in/random/color-purple/",
         "summary": "",
         "date_published": "2016-10-17 00:00:00 +0530",
          "categories"  : [
                 "random"
                
                
                ],
         
         
          "tags"  : [
                
                ]
         
         
    },

    {
         "id": "/random/fascism",
         "date"     : "October 15, 2016",
         "title": "Fascism",
         "content_html": "<p>The Oxford English Dictionary defines fascism as: <em>“An authoritian and nationalistic right wing form of the government.”</em> It also further states that: <em>” Fascism tends to include a belief in the supremacy of one national or ethnic group, contempt for democracy, an insistence on obedience to a powerful leader and strong demagogic approach.”</em> And how many times one goes by the book? I as individual partially disagree with above definition, and believe that though they consider one national or ethnic group as supreme they might include other group or people from other group if they need their support (For e.g.: In the movie The Pianist there is group of Jews’ who help S.S. in sending other Jews to concentration camps. This is seen in scene where Spilzmann’s family is loaded to the train but Spilzmann’s Jew friend gets him away from the train and asks him to run away). This is also mentioned by Mussolini in his book on Fascism.</p>\n\n<p>Some scholars view fascism in narrow terms, and insist that the ideology was limited to Italy under Mussolini, as he was founder of National Fascist Party. This point troubled me a lot while writing on this topic for the first time. But some writers define fascism more broadly to include many movements, from Italian Fascism to contemporary neo-Nazi movements in the United States which according to me should fit under this term. I also read a very apt definition of Fascism by <strong>Kurt Vonnegut</strong> in his satirical novel <em>‘Breakfast of Champions’</em>. It states that: <em><strong>” Fascism was a fairly popular political philosophy which made sacred whatever nation and race the philosopher happened to belong to.”</strong></em>\nFascism gained popularity because many intellectuals, artists, and political thinkers in the late 19th century began to reject the philosophical emphasis on rationality and progress that had emerged from the 18th century intellectual movement in Europe known as the Enlightenment. Even today looking towards the ideas of rationality presented during Enlightenment period I doubt their correctness. Popular enthusiasm for such movements was especially strong in Germany and Italy, whose parliamentary traditions were weak as they became nations in late 18th century. Despite having fought on opposite sides, both countries emerged from the war to face political instability and a widespread feeling that the nation had been humiliated in the war and by the settlement terms of the Treaty of Versailles which heavily favored the winning sides.</p>\n\n<p>The basic characteristics of fascist movements are that they attempt revolutionary change and mainly focus on popularizing myths of national or ethnic renewal. Seen from this perspective, all forms of fascism have three common features: anticonservatism, a myth of ethnic or national renewal, and a conception of a nation in crisis. Also generally it is seen that fascist regimes have authoritian figures that are hypocrites and have different policies for different set of people. For e.g.: In the Pianist, the Jews who help S.S. in capturing other Jews are treated leniently than other Jews. Also the ‘Aryan Population’ in Poland quickly adapted to order which asked all Jews to wear Star of David on their Sleeve and shunned them whenever they came across any Jew in the streets.</p>\n\n<p>German National Socialism differed from Italian Fascism in important ways. The most important differences were Nazism’s commitment to a more extreme degree of totalitarian control, and its racist conception of the ideal national community (Aryanism). Hitler’s visionary fanaticism called for the <em>Gleichschaltung</em> (coordination) of every possible aspect of life in Germany. In the movie the Great Dictator, Adenoid Hynkel, controlled the land of Tomaina, his minions organized themselves into militarist formations to please their dictator. The vision of totalitarianism control as seen in fictional Tomania was similar to that day Germany. The totalitarianism that resulted in Germany went further than that of Italy. They ostracized races other than Aryans as they regarded them as ‘subhuman’. Italian Fascism lacked the ideological fervor to indulge in systematic ethnic cleansing on the scale seen in Germany because it didn’t have a long tradition of anti-Semitism feelings in its population unlike the latter. Although the Italian Fascist government did issue anti-Semitic laws by taking example from Germany, but did not think about mass extermination of its Jewish population. In Italy Fascism also was marked by pluralism, compromise, and inefficiency as compared to Nazism. As a result, in Fascist Italy far more areas of personal, social, and cultural life escaped the intrusion of the state than in Nazi Germany.</p>\n\n<p>Also what set them apart from other fascist movements is that they developed an ideology in the context of a modern economy and society. Even after defeat in World War I, the country was still one of the most advanced nations in the world in terms of infrastructure, government efficiency, industry, economic potential, and standards of education. Germany also had a deep sense of national pride, belonging, and roots, and a civic consciousness that stressed duty and obedience and had a long tradition of anti-Semitism and imperialism, and also respect for gifted leaders. The institution of democracy had only weak roots in Germany, and after World War I democracy was widely rejected as un-German.</p>\n\n<p>One of the new entrants to fascist states that have emerged after WWII is ISIS (Islamic State of Iraq and the Levant). ISIS is an unrecognized state in the Iraq region, is an anti-Shiaism, extremist Sunni state. The ISIS has committed exterminations of many Shias, people of other religions and people of foreign descent. It controls large parts of Middle East and has about 100, 000 fighters and all of them practice racial discrimination against other religions. The ideology of Islam in danger from western influences and laying their lives for their religion and dying as martyrs, is used as most important point in recruiting fighters. Due to racism faced by many Muslims in Western countries, many feel lost and ostracized in western world and are actively joining ranks of ISIS. As per current CIA estimate about 10,000 foreign fighters have joined ISIS since February 2014. This example shows that fascist groups are still present in modern world and are still going strong.</p>\n\n<p>On a closing note I would like to assert my thoughts on fascism and the term fascist with reference to political lexicon in JNU. I believe that fascism though is a relatively new term, as it originated in 20th century. But I still have doubts on what should I consider and what should I leave while truly defining fascism according to me. There have been many fascist movements in past three score years but each of them is distinctly different, but is called fascist movements as they are very similar to fascist movements in Germany and Italy at the time of World Wars. But if compared to each other these movements may not have a single trait in common. Also while skimming to various posters of Leftist Political parties in JNU, one can find that they refer to right winged political parties as fascist. Yeah, they say that but these right winged parties cannot be called fascists as they do not want to create a revolutionary new order in the society nor do they put forward flagrant theories to their racist views.</p>\n\n<p>And finally I hope that I have conveyed to the reader the essence of the topic and its relevance todays scenario and a wish that I write on a better and interesting topic next time around.</p>\n\n<h4 id=\"citations\">Citations</h4>\n\n<ul>\n  <li>Griffin, Roger D. “Fascism.” Microsoft® Student. Redmond, WA: ©Microsoft Corporation, 2012.</li>\n  <li>“National Socialism.” Microsoft® Student. Redmond, WA: ©Microsoft Corporation, 2012.</li>\n  <li>Mussolini, Benito. “Fascism: Doctrine and Institutions” An Italian dictator from 1922-1943. Under Public domain.</li>\n  <li>Vonnegut, Kurt. “Breakfast of Champions”. ©Penguin Press Inc., 2003.</li>\n  <li>Hornby, A.S. “The Oxford Unabridged Dictionary of Current English”. ©Oxford University Press, 2011.</li>\n  <li>Arendt, Hannah. “The Origins of Totalitarianism”. Harcourt, 1951. Rev ed. P. Smith, 1983. Definitive study of totalitarian movements.</li>\n  <li>The Department of Special Collections within the University of Wisconsin-Madison’s Memorial Library. “Italian Life under Fascism”. https://www.library.wisc.edu/libraries/dpf/Fascism/Home.html</li>\n  <li>Eatwell, Roger. “Fascism: A History”. ©Penguin, 1997. Overview of the history of fascism.</li>\n  <li>Fischer, Klaus P. “Nazi Germany: A New History”. ©Continuum, 1995.</li>\n  <li>Associated Press. “On ISIS”. Published in the Hindustan Times (21st October, 2014).</li>\n  <li>Leech, Robb. “Don’t blame my brother for becoming a jihadi”. The Guardian. Published in the Hindustan Times (25th October, 2014).</li>\n</ul>\n",
         "url": "https://blog.alokprateek.in/random/fascism/",
         "summary": "",
         "date_published": "2016-10-15 00:00:00 +0530",
          "categories"  : [
                 "random"
                
                
                ],
         
         
          "tags"  : [
                
                ]
         
         
    },

    {
         "id": "/random/feynman-tecnique",
         "date"     : "July 26, 2016",
         "title": "Learn Anything in 4 Steps",
         "content_html": "<p>With the Feynman Technique, you can learn anything by teaching someone else a topic in simple terms. This will allow you to quickly pinpoint the holes in your knowledge. After following these four steps, you’ll be able to understand concepts more deeply and better retain the information.</p>\n\n<h2 id=\"keep-it-simple-scientist\">Keep It Simple, Scientist</h2>\n\n<p>The Feynman Technique is a mental model that was coined by Nobel-prize winning physicist Richard Feynman. Known as the “<strong>Great Explainer</strong>,” Feynman was revered for his ability to clearly illustrate dense topics like quantum physics for virtually anybody. In “<em>Feynman’s Lost Lecture: The Motion of Planets Around the Sun</em>,” David Goodstein writes that Feynman prided himself on being able to explain the most complex ideas in the simplest terms.</p>\n\n<p>Goodstein once asked Feynman to explain why “spin one-half particles obey Fermi-Dirac.” Feynman replied that he’d prepare a freshman lecture on it, but then he came back a few days later empty-handed. “I couldn’t reduce it to freshman level,” he admitted to Goodstein. “That means we don’t really understand it.”</p>\n\n<p>That is to say, if Feynman couldn’t explain something in simple terms, there was a problem with the information, not with Feynman’s teaching ability.</p>\n\n<h2 id=\"the-feynman-technique\">The Feynman Technique</h2>\n\n<h3 id=\"first-step-write-it-out-for-a-child\">First Step: Write it out for a child</h3>\n\n<p>Take out a blank sheet of paper. At the top write the subject you want to learn. Now write out everything you know about the subject you want to understand as if you were teaching it to a child. Not your smart adult friend, but rather an 12-year-old who has just enough vocabulary and attention span to understand basic concepts and relationships.</p>\n\n<p>It turns out that one of the ways we trick ourselves is that we use complicated vocabulary and jargon and it masks our lack of understanding.</p>\n\n<p>When you write out an idea from start to finish in simple language that a child can understand, you force yourself to understand the concept at a deeper level and simplify relationships and connections between ideas.</p>\n\n<p>Some of this will be easy. These are the places where you have a clear understanding of the subject. At other points, you will struggle. These are the points where you have some gaps in your understanding.</p>\n\n<h3 id=\"second-step-review-it\">Second Step: Review it</h3>\n\n<p>Only when you encounter gaps in your knowledge—where you’re forgetting something important, are not able to explain it, or simply have trouble thinking of how variables interact—can you really start learning.</p>\n\n<p>Now that you know where you got stuck, go back to the source material and re-learn it until you can explain it in basic terms. Only when you can explain your understanding without jargon and in simple terms can you demonstrate your understanding. This is the work required to learn and skipping it leads to the illusion of knowledge.</p>\n\n<p>Identifying the boundaries of your understanding also limits the mistakes you’re liable to make and increases your chance of success when applying knowledge.</p>\n\n<h3 id=\"third-step-organize-and-simplify\">Third Step: Organize and Simplify</h3>\n\n<p>Now you have a set of hand-crafted notes. Review them to make sure you didn’t mistakenly borrow any of the jargon from the source material. Organize them into a simple narrative that you can tell. Read it out loud. If the explanation isn’t simple or sounds confusing that’s a good indication that your understanding in that area still needs some work.</p>\n\n<p>If you follow this approach over and over you will end up with a binder full of pages on different subjects. If you take some time twice a year to go through this binder and update your knowledge you will keep your knowledge.</p>\n\n<h3 id=\"fourth-step-optional-transmit\">Fourth Step (Optional): Transmit</h3>\n\n<p>If you really want to be sure of your understanding, run it past someone (ideally who knows little of the subject –or find that 12-year-old!). The ultimate test of your knowledge will your capacity to convey it to another.</p>\n\n<h2 id=\"the-perks-\">The Perks 😀</h2>\n\n<p>Not only is the Feynman Technique a wonderful recipe for learning, but it’s also a window into a different way of thinking that allows you to tear ideas apart and reconstruct them from the ground up.</p>\n\n<p>When you’re having a conversation with someone and they start using words or relationships that you don’t understand, ask them to explain it to you like you’re 12. Not only will you supercharge your own learning, you’ll supercharge theirs. Importantly, approaching problems in this way allows you to understand when others don’t know what they are talking about.</p>\n",
         "url": "https://blog.alokprateek.in/random/feynman-tecnique/",
         "summary": "",
         "date_published": "2016-07-26 00:00:00 +0530",
          "categories"  : [
                 "random"
                
                
                ],
         
         
          "tags"  : [
                
                ]
         
         
    }



We have looped through all site.posts and created a JSON object with each post data separating the objects with a comma. After building your website, Jekyll will take care of parsing the YAML and Liquid data and outputting output.json with your posts data in the JSON format.

Go ahead and test it with a Jekyll blog, serve it or build it then look inside of your _site folder for your output.json with posts data. Or just visit 127.0.0.1:4000/output.json to see the result.

If you use use github pages go to your blog link /output.json and see the result.

The limit meta in the front matter controls the number of posts to output as JSON.

Using the output as API

It’s simple! Place the output.json under a new folder called api and rename it index.json.

Making this API as JSON feed

I read about the JSON feed spec, and I was intrigued by the novelty of it — not the ease of using JSON as much as the insurmountable pain of using Atom XML.

For most developers, JSON is far easier to read and write than XML. Developers may groan at picking up an XML parser, but decoding JSON is often just a single line of code.

Since I already been using Jekyll for my blog, writing the code would need to be done in Liquid without any plugins.

Also in the example we already have a API ready, Why not use it?


---
layout: none
---
{
    ""version": "https://jsonfeed.org/version/1",
    "title": "Alok Prateek",
    "description": "Meteoric Teachings is a blog on programming, hardware and random things about tech",
    "home_page_url": "https://blog.alokprateek.in/",
    "feed_url": "https://blog.alokprateek.in/api/index.json",
    "icon": "https://blog.alokprateek.in/assets/favicon/android-chrome-192x192.png",
    "favicon": "https://blog.alokprateek.in/favicon.ico",
    "author": {
        "name": "{"name"=>"Alok Prateek", "avatar"=>"/assets/static/avatar2.png", "bio"=>"A full-stack developer interested in web, cloud and apis.", "location"=>"Delhi, India", "email"=>"i@alokprateek.in", "uri"=>"https://alokprateek.in", "home"=>nil, "bitbucket"=>nil, "codepen"=>nil, "dribbble"=>nil, "flickr"=>nil, "facebook"=>nil, "foursquare"=>nil, "github"=>"oxyenyos", "gitlab"=>nil, "google_plus"=>nil, "keybase"=>nil, "instagram"=>"thewhitewulfy", "lastfm"=>nil, "linkedin"=>"alokprateek", "pinterest"=>nil, "soundcloud"=>nil, "stackoverflow"=>nil, "steam"=>nil, "tumblr"=>nil, "twitter"=>"theWhiteWulfy", "vine"=>nil, "weibo"=>nil, "xing"=>nil, "youtube"=>nil}",
        "url": "https://alokprateek.in/",
        "avatar": "https://alokprateek.in/avatar3.jpg"
    },
    "expired": false,
    "items": [
           ]
}

Under items whatever existed in index.json before goes in, without the front matter, that remains the same.

Fields like icon, favicon, and author depend on your particular implementation, and I didn’t feel like generalizing the code by using front-matter variables rather I just pasted the values directly.

Second, you’ll have to read the spec for the full info on which fields are optional and mandatory.

That’s about it! 😊

For a final example take a look at my final JSON. And you can curl at this link blog.alokprateek.in/api/


---
limit: 10
layout: none
---
{
    "version": "https://jsonfeed.org/version/1",
    "title": "Alok Prateek",
    "description": "Meteoric Teachings is a blog on programming, hardware and random things about tech",
    "home_page_url": "https://blog.alokprateek.in/",
    "feed_url": "https://blog.alokprateek.in/api/index.json",
    "icon": "https://blog.alokprateek.in/assets/favicon/android-chrome-192x192.png",
    "favicon": "https://blog.alokprateek.in/favicon.ico",
    "author": {
        "name": "{"name"=>"Alok Prateek", "avatar"=>"/assets/static/avatar2.png", "bio"=>"A full-stack developer interested in web, cloud and apis.", "location"=>"Delhi, India", "email"=>"i@alokprateek.in", "uri"=>"https://alokprateek.in", "home"=>nil, "bitbucket"=>nil, "codepen"=>nil, "dribbble"=>nil, "flickr"=>nil, "facebook"=>nil, "foursquare"=>nil, "github"=>"oxyenyos", "gitlab"=>nil, "google_plus"=>nil, "keybase"=>nil, "instagram"=>"thewhitewulfy", "lastfm"=>nil, "linkedin"=>"alokprateek", "pinterest"=>nil, "soundcloud"=>nil, "stackoverflow"=>nil, "steam"=>nil, "tumblr"=>nil, "twitter"=>"theWhiteWulfy", "vine"=>nil, "weibo"=>nil, "xing"=>nil, "youtube"=>nil}",
        "url": "https://alokprateek.in/",
        "avatar": "https://alokprateek.in/avatar3.jpg"
    },
    "expired": false,
    "items": [

    {
      "title": "Make any Jekyll site into a PWA",
      "date"     : "August 06, 2019",
      "url": "https://blog.alokprateek.in/development/jekyll-pwa/",
      "summary": "<p>A Progressive Web App, or PWA, uses modern web capabilities to deliver an app-like user experience. Any website can be made into a PWA.</p>\n",
      "content_html": "A Progressive Web App, or PWA, uses modern web capabilities to deliver an app-like user experience. Any website can be made into a PWA.\n\n## The basics\n\nTurning a basic website into a PWA is easy and has a lot of benefits, but first, let us know more about them in brief.\n\nAt its core Progressive Web App is just a way to optimize your website for better, faster delivery. As a developer we should learn to take advantage of these new possibilities, regardless of what our content is.\n\nMy own site is just a bunch of static HTML, and my blog is based on Jekyll, and they are still perfectly valid Progressive Web App. If you run anything on the web, you can definitely benefit from this.\n\nThe beauty is that PWAs offer the best of both worlds - deep linking and URLs from the web, offline access, push notifications and more device specific features from native apps - while still staying completely platform-independent. Just the web. If an older browser does not support it, it will not break; it just falls back to the default: a regular website. And yes there are few services out there that can make your PWA into an app, that you can just publish to the app stores.\n\nThere are some serious advantages:\n\n- A faster, more secure user experience\n- A better Google ranking\n- Better usability\n- Better performance\n- Offline access\n- Home screen shortcut like native apps\n\nEven if you don’t expect your users to “install” your PWA (e.g. place a shortcut on their home screen), there is still a lot to be gained by making the switch. In fact, all of the steps necessary to make a PWA will actively improve your website and many of them are considered as best practices.\n\n## How do I do it in Jekyll?\n\nWe will begin with the manifest and move to the JavaScript parts. Jekyll uses a build system based on partials that we will take advantage of.\n\nThe second part of the series will take a look on how we can make any static website a PWA and the third part will deal with using device specific features in a PWA.\n\nWe will partially take advantage of [PWA-Builder](https://www.pwabuilder.com) to do many things in this tutorial.\n\n## The Manifest\n\nA manifest is just a JSON file that describes all the meta data of your PWA. Things like the name, language and icon of your app go in there. This information will tell browsers how to display your app when it’s saved as a shortcut.\n\n```json\n{\n  \"lang\": \"en\",\n  \"dir\": \"ltr\\rtl\",\n  \"name\": \"This is my jekyll PWA\",\n  \"short_name\": \"myPWA\",\n  \"icons\": [\n    {\n      \"src\": \"\\/assets\\/images\\/touch\\/android-chrome-192x192.png\",\n      \"sizes\": \"192x192\",\n      \"type\": \"image\\/png\"\n    }\n  ],\n  \"theme_color\": \"#1a1a1a\",\n  \"background_color\": \"#1a1a1a\",\n  \"start_url\": \"/\",\n  \"display\": \"standalone\",\n  \"orientation\": \"natural\"\n}\n\n```\n\nThis is usually called `manifest.json` or `site.webmanifest`, and linked to from the `<head>` of your site as\n\n```html\n<link rel=\"manifest\" href=\"manifest.json\">\n\n```\n\nRegarding what fields can be there in a manifest file see [MDN](https://developer.mozilla.org/en-US/docs/Web/Manifest).\n\nFor Jekyll we will do few changes to `manifest.json` so that we can make changes directly from `_config.yml` and prevent jekyll to render it using default layout (which might insert the json into html for some themes).\n\nThe `<head>` portion will come in the `partial` that builds the head of every page. Usually it would be located in `_partials`.\n\n```json\n\n---\nlayout: none\n\n---\n\n{\n  \"lang\": \"{{ site.language }}\",\n  \"dir\": \"{{ site.lang_direction }}\",\n  \"name\": {{ site.name | smartify | jsonify }},\n  \"short_name\": {{ site.short_name | smartify | jsonify }},\n  \"icons\": [\n    {\n      \"src\": \"\\/assets\\/images\\/touch\\/android-chrome-192x192.png\",\n      \"sizes\": \"192x192\",\n      \"type\": \"image\\/png\"\n    }\n  ],\n  \"theme_color\": \"{{ site.color }}\",\n  \"background_color\": \"{{ site.color }}\",\n  \"start_url\": \"{{ site.url }}\",\n  \"display\": \"standalone\",\n  \"orientation\": \"natural\"\n}\n\n```\n\nAnd in the `_config.yml` we might already have these following fields, if not we can always add it there.😅\n\n```yaml\n\nname: \"mysite\"\nshort_name: \"ms\"\nurl: \"https://mysite.com\"\nlanguage: \"en\"\nlang_direction: \"ltr\"\ncolor: \"#abc123\"\n\n```\n\nSo your manifest is set up. Now we move to next part.\n\n## Register the service worker\n\nNow we need to add the JavaScript that registers the service worker into the `partial` that forms the `<head>` of your every page. As before it would usually  be located in `_partials`.\n\nWe need to add the following piece of JavaScript in `<script>` tag.\n\n```js\n\nif (\"serviceWorker\" in navigator) {\n  if (navigator.serviceWorker.controller) {\n    console.log(\"An active service worker found, no need to register\");\n  } else {\n    // Register the service worker\n    navigator.serviceWorker\n      .register(\"{{ site.baseurl }}/serviceworker.js\", {\n        scope: \"./\"\n      })\n      .then(function (reg) {\n        console.log(\"Service worker has been registered for scope: \" + reg.scope);\n      });\n  }\n}\n\n```\n\n## Service Worker\n\nNow we move to the next step. We need to create the `serviceworker.js` at the root of your site.\n\nIt will have the following JavaScript:\n\n```js\n\nconst CACHE = \"pwabuilder-offline\";\n\nconst offlineFallbackPage = \"index.html\";\n\n// Install stage sets up the index page (home page) in the cache and opens a new cache\nself.addEventListener(\"install\", function (event) {\n  console.log(\"Install Event processing\");\n\n  event.waitUntil(\n    caches.open(CACHE).then(function (cache) {\n      console.log(\"Cached offline page during install\");\n\n      if (offlineFallbackPage === \"ToDo-replace-this-name.html\") {\n        return cache.add(new Response(\"Update the value of the offlineFallbackPage constant in the serviceworker.\"));\n      }\n      \n      return cache.add(offlineFallbackPage);\n    })\n  );\n});\n\n// If any fetch fails, it will look for the request in the cache and serve it from there first\nself.addEventListener(\"fetch\", function (event) {\n  if (event.request.method !== \"GET\") return;\n\n  event.respondWith(\n    fetch(event.request)\n      .then(function (response) {\n        console.log(\"Add page to offline cache: \" + response.url);\n\n        // If request was success, add or update it in the cache\n        event.waitUntil(updateCache(event.request, response.clone()));\n\n        return response;\n      })\n      .catch(function (error) {        \n        console.log(\"Network request Failed. Serving content from cache: \" + error);\n        return fromCache(event.request);\n      })\n  );\n});\n\nfunction fromCache(request) {\n  // Check to see if you have it in the cache\n  // Return response\n  // If not in the cache, then return error page\n  return caches.open(CACHE).then(function (cache) {\n    return cache.match(request).then(function (matching) {\n      if (!matching || matching.status === 404) {\n        return Promise.reject(\"no-match\");\n      }\n\n      return matching;\n    });\n  });\n}\n\nfunction updateCache(request, response) {\n  return caches.open(CACHE).then(function (cache) {\n    return cache.put(request, response);\n  });\n}\n\n```\n\nNow you're all done with the JavaScript part.\n\n## Looking forward\n\nPush these changes to your Jekyll site and voila! It is now a PWA.😁\n\nI intentionally missed the part where we map the icons to the config to keep things simple, if you need help with that, drop me a comment below and I'll show you how.\n\nAlso HTTPS is essential for the site to be a PWA. Most likely you might already have heard of it and maybe using it, so I didn't stress on it.\n\n[OPTIONAL] You can check the status of your PWA by Lighthouse Audit.😄\n\n## Make your app\n\nYes!\n\nIf you have reached so far why not go a step further?\n\nIf you want you can build your apps to be uploaded to Microsoft Store, Play Store and App Store via [PWA-Builder](https://www.pwabuilder.com).\n\nFirst you'll have to enter the url of your site and click enter. It will rate your PWA out of 100. If you followed this guide you'll get 95. Not bad. 😅\n\nYou will see a bright purple button on top right, a page will come with instructions to download the apps and proceed further. If you need help, you can always drop a comment below.😀\n\n\n##### Until next time!\n\nCheers!🍻",
       "categories"  : [
         "development"
        
        
        ],
      
      
       "tags"  : [
        
        ]
      
      

    }
    ,

    {
      "title": "AWS Terms",
      "date"     : "July 19, 2019",
      "url": "https://blog.alokprateek.in/development/aws-terms/",
      "summary": "<p>There are many terms in AWS that use confusing names for simple things.\nEven working with AWS for over a year, I really miss out on some terms. That’s why I wrote this article. Typing whatever I remember. I am studying these for my AWS exam, which I will take in a few weeks!</p>\n",
      "content_html": "There are many terms in AWS that use confusing names for simple things.\nEven working with AWS for over a year, I really miss out on some terms. That's why I wrote this article. Typing whatever I remember. I am studying these for my AWS exam, which I will take in a few weeks! \n\nSo here are the terms:\n\n## Terms\n\n1. **Access control list (ACL)**: A firewall/security layer on the subnet level\n2. **Auto scaling**: Automates the process of adding or removing EC2 instances based on traffic demand for your application\n3. **Buckets**: Root-level “folders”\n4. **CloudFront**: Content delivery network (CDN) that allows you to store your content at “edge locations” located all around the world, allowing customers to access your content more quickly\n5. **CloudTrail**: Allows you to monitor all actions taken by IAM users\n6. **CloudWatch**: Service that allows you to monitor various elements of your AWS account\n7. **Consolidated billing**: Allows you to view, manage, and pay bills for multiple AWS accounts in one user interface\n8. **DNS server**: A database of website domains and their corresponding IP addresses\n9. **DynamoDB**: NoSQL database service that does not provide other NoSQL software options\n10. **Elastic Compute Cloud (EC2)**: A virtual computer, very similar to a desktop/laptop computer\n11. **Elastic Load Balancing (ELB)**: Evenly distributes traffic between EC2 instances that are associated with it\n12. **ElastiCache**: Data caching service used to help improve the speed/performance of web applications running on AWS\n13. **Elasticity**: The ability of a system to increase and decrease in size\n14. **Fault tolerance**: Property that enables a system to continue operating properly in the event of the failure of one or more components\n15. **Firewall**: A type of software that either allows or blocks certain kinds of internet traffic to pass through it\n16. **Folder**: Any “subfolder” created in a bucket\n17. **High availability**: Refers to systems that are durable and likely to operate continuously without failure for a long time\n18. **IAM users**: Individuals who have been granted access to an AWS account\n19. **Identity and Access Management (IAM)**: Service where AWS user accounts and their access to various AWS services are managed\n20. **Lambda**: Serverless computing that will replace EC2 instances, for the most part\n21. **Object availability**: Percent over a one-year time period that a file stored in S3 will be accessible\n22. **Object durability**: Percent over a one-year time period that a file stored in S3 will not be lost\n23. **Object lifecycle**: Set rules to automatically transfer objects between storage classes at defined time intervals\n24. **Object sharing**: Ability to make any object publicly available via a URL link\n25. **Object versioning**: Automatically keep multiple versions of an object (when enabled)\n26. **Organizations**: Allow you or your company access to manage billing and access to multiple AWS accounts in one user interface\n27. **Principle of least privilege**: Giving a user only the rights/access to the AWS services and resources they need to do their job and nothing more\n28. **Publishers**: Human/alarm/event that gives SNS the message that needs to be sent\n29. **Relational Database Service (RDS)**: SQL database service that provides a wide range of SQL database options to select from\n30. **RedShift**: Data warehouse database service designed to handle petabytes of data for analysis\n31. **Roles**: How different AWS services are granted permission to communicate and share data\n32. **Route 53**: Where you configure and manage web domains for websites or applications you host on AWS\n33. **Scalability**: The ability of a system to easily increase in size and capacity in a cost-effective way\n34. **Security group (SG)**: Firewall/security layer on the server/instance level\n35. **Shared responsibility model**: Defines what you and AWS are responsible for when it comes to security and compliance\n36. **Simple Notification Service (SNS)**: AWS service that allows you to automate the sending of email or text messaging notifications based on events that happen in your AWS account\n37. **Simple Storage Service (S3)**: Online bulk storage service you can access from almost any device\n38. **Storage class**: Represents “classification” assigned to each object in S3 (standard, RRS, S3-IA, Glacier)\n39. **Subnet**: A subsection of a network and generally includes all the computers in a specific location\n40. **Subscriptions**: Endpoints to which a topic sends messages\n41. **Topics**: How you label and group different endpoints to which you send messages\n42. **Trusted Advisor**: Service that “advises” and helps you optimize aspects of your AWS account\n43. **User credentials**: IAM user’s username and password for logging in to AWS\n44. **Virtual Private Cloud (VPC)**: A private subsection of AWS you control and in which you can place AWS resources\n\n**Do tell me what I've missed! It will help both me and the community. :-) **",
       "categories"  : [
         "development"
        
        
        ],
      
      
       "tags"  : [
        
        ]
      
      

    }
    ,

    {
      "title": "Introduction To Accessibility",
      "date"     : "July 16, 2019",
      "url": "https://blog.alokprateek.in/development/web-accessibility/",
      "summary": "<p>Accessibility is a term you keep hearing, but may not fully understand. This is in part because the word itself can be a bit confusing. The root word, access, makes the concept seem tied to things like passwords. If users can “access” your site, accessibility is checked off. If only it were that simple.</p>\n",
      "content_html": "Accessibility is a term you keep hearing, but may not fully understand. This is in part because the word itself can be a bit confusing. The root word, access, makes the concept seem tied to things like passwords. If users can “access” your site, accessibility is checked off. If only it were that simple.\n\nWeb accessibility is really about a user’s ability to access your site’s content, regardless of any physical or mental impairments. The inventor of the internet, **Sir Tim Berners-Lee**, put it perfectly:\n\n> “The power of the Web is in its universality. Access by everyone regardless of disability is an essential aspect.”\n\nA truly accessible website is inclusive of every potential user. It covers differential abilities of all shapes, sizes, and permanence. Users who are blind have their own needs, as do users with a broken hand. There’s also overlap among accessibility groups. Users experiencing concussion symptoms can benefit from features designed to make a piece of content more accessible for users who experience seizures. Accessibility is a multi-faceted topic.\n\nThere are six basics principles that make web better for everyone!\n\n## Have correct text size\n\nUsers of the Internet have varying eye sight levels (due to injury, disease or age factor) and it's important to have a decent font size so that everyone can read your website without strain.\n\nBrowsers come at with a default font size of `16px`. We should try to not go below that at least. Take `16px` as your smallest base and build your text hierarchy upwards.\n\nAt the very minimum set your font sizes in em unit so that users can zoom in your website to increase font sizes.\n\n> Except for captions and images of text, text can be resized without assistive technology up to 200 percent without loss of content or functionality.\n> - w3.org\n\n## Better Color Contrast\n\nUsers of the Internet have varying eye sight levels and it's important to have a good contrast so that everyone can read your websites without strain. My dad has deuteranopia. He can't see all colors as I do, which i discovered when I was in middle school. These days I use a plugin that checks for color issues. More on that later.\n\nThis is why there is a recommended guideline just to prevent this issue. It requires that,\n\n> The visual presentation of text and images of text has a contrast ratio of at least 4.5:1.\n> - w3.org\n\n## Make text content easy to read and understandable\n\nSome sentences are just highly compounded and complex that require the reader to put in extra mental focus to figure out the overall meaning of the sentence. It might still be understandable by many people. But there are people with disabilities, including reading disabilities, even among highly educated users with specialized knowledge of the subject matter. It may be possible to accommodate these users by making the text more readable.\n\nHere is the required guideline:\n\n> When text requires reading ability more advanced than the lower secondary education level after removal of proper names and titles, supplemental content, or a version that does not require reading ability more advanced than the lower secondary education level, is available.\n> - w3.org\n\nIn short,\n\n- Avoid difficult and less common words\n- Write short sentences\n- Don't use more than two conjunctions in a sentence\n- Bullet points help wherever applicable\n\n## Labelled Form Controls\n\nYes, we know that once a while we see a checkbox that is too small to be clicked. A normal size checkbox could have been just fine for you to click easily. But important thing to understand here is that even the normal size checkbox can be difficult to click for some people. Specially the ones with weak motor skills i.e. Ability to do a pre-determined movement with maximum certainty.\n\nThis is one of the reasons why there is a recommended guideline to associate a `<label>` element with the `<input>` element (with all form controls in general). This makes the label also a clickable part of the form control. So you don't have to pin-point the form control.\n\n> Present instructions or labels that identify the controls in a form so that users know what input data is expected.\n> - w3.org\n\nAgain, note that this is just one of the reasons why form controls should be correctly labelled. There are more benefits to it, Which I will come to in the next part\n\n## Labels or Instructions\n\nUnfortunately, the developer decided to put it as the placeholder of the input. Placeholders vanish as soon as any text is entered in the input field.\n\nWhat's wrong in it? Nowadays many input fields in the forms are auto-filled by browsers for us. In such a situation, if the user wants to cross-check the filled values if they are appropriate, they have no way to know what's really asked in a particular input field! The same issue also applies to a user with short memory who started filling the form and then wants to verify the fields mid-way. So always label your input fields such that the label/instruction is accessible to the user at all times.\n\n> Present instructions or labels that identify the controls in a form so that users know what input data is expected.\n> - w3.org\n\n## Adjustable Timings\n\n>Ensure that users with disabilities are given adequate time to interact with Web content whenever possible. People with disabilities such as blindness, low vision, dexterity impairments, and cognitive limitations may require more time to read content or to perform functions such as filling out on-line forms.\n> - w3.org\n\nWebsites are filled with things like alerts, notification etc that show for a short duration and then go away. Here are few things you can do to make them more accessible:\n\n- Make them stay longer.\n- Show how much time is left before they go away.\n- Pause their timer when hovered or focused.\n\nIn the past few points, you went through some examples of web content. The motive of those examples was two-fold:\n\n- To display few ways in which websites are generally found inaccessible.\n- To bring forth the fact that what you find okay for yourself, can be inaccessible for someone else. So the best we can do to make our websites accessible to most people is - Follow the recommended guidelines.\nHope it was a learning experience for you. If it was, please pass this on to every other developer, designer, marketer, any you know who works with websites.\n\nLet's make the Web a better place!\n\nDid I miss something? or You can share some more better tips?\nPlease leave your views in comments!\n",
       "categories"  : [
         "development"
        
        
        ],
      
      
       "tags"  : [
        
        ]
      
      

    }
    ,

    {
      "title": "Blog API on Github Pages",
      "date"     : "July 14, 2019",
      "url": "https://blog.alokprateek.in/development/jekyll-api-gh-pages-and-json-feed/",
      "summary": "<p>We are going to see how to build an API for static websites powered by Jekyll, so you can consume static data via any web/mobile application.</p>\n",
      "content_html": "We are going to see how to build an API for static websites powered by Jekyll, so you can consume static data via any web/mobile application.\n\nWe will also see how we can use the API for JSON feed.\n\n## Steps\n\n### Output data as JSON\n\nIf you just need to output some data as JSON you can easily do that using the `jsonify` filter.\n\nAll variables in the front matter of your site will be accessible via site variable so we took our YAML array `site.whatever` and convert it to JSON with the `jsonify` liquid filter.\n\nNow let's try with a more practical example. What if you want to get the JSON output of all your posts in a JSON file. That's also not hard using Jekyll. You can do it following these two steps:\n\n- First create the output file with a name, let's call it `output.json`.\n\n- Next open the `output.json` file and add the following code:\n\n```liquid\n\n---\n  limit: 10\n---\n\n{% for post in site.posts limit: page.limit %}\n    {\n         \"id\": \"{{ post.id }}\",\n         \"date\"     : \"{{ post.date | date: \"%B %d, %Y\" }}\",\n         \"title\": {{ post.title | smartify | jsonify }},\n         \"content_html\": {{ post.content | jsonify }},\n         \"url\": \"{{ site.url }}{{ post.url }}\",\n         \"summary\": {% if post.url contains \"/blog/\" %}{{ post.excerpt | smartify | jsonify }}{% else %}{{ post.description | smartify | jsonify }}{% endif %},\n         \"date_published\": \"{{ post.date }}\",\n         {% if post.categories %} \"categories\"  : [\n                {% for category in post.categories %} \"{{ category }}\"\n                {% if forloop.last %}{% else %},{% endif %}\n                {% endfor %}\n                ],\n         {% endif %}\n         {% if post.categories == nil %} \"categories\"  : [],  {% endif %}\n         {% if post.tags %} \"tags\"  : [\n                {% for tag in post.tags %} \"{{ tag }}\"\n                {% if forloop.last %}{% else %},{% endif %}\n                {% endfor %}\n                ]\n         {% endif %}\n         {% if post.tags == nil %} \"tags\"  : []  {% endif %}\n    }{% unless forloop.last == true %},{% endunless %}\n{% endfor %}\n\n\n```\n\nWe have looped through all `site.posts` and created a JSON object with each post data separating the objects with a comma. After building your website, Jekyll will take care of parsing the YAML and Liquid data and outputting `output.json` with your posts data in the JSON format.\n\nGo ahead and test it with a Jekyll blog, serve it or build it then look inside of your `_site` folder for your `output.json` with posts data. Or just visit `127.0.0.1:4000/output.json` to see the result.\n\nIf you use use github pages go to your blog link `/output.json` and see the result.\n\nThe `limit` meta in the front matter controls the number of posts to output as `JSON`.\n\n### Using the output as API\n\nIt's simple! Place the `output.json` under a new folder called `api` and rename it `index.json`.\n\n### Making this API as JSON feed\n\nI read about the [JSON feed spec](https://jsonfeed.org/version/1), and I was intrigued by the novelty of it — not the ease of using JSON as much as the insurmountable pain of using Atom XML.\n\nFor most developers, JSON is far easier to read and write than XML. Developers may groan at picking up an XML parser, but decoding JSON is often just a single line of code.\n\nSince I already been using Jekyll for my blog, writing the code would need to be done in Liquid without any plugins.\n\nAlso in the example we already have a API ready, Why not use it?\n\n```liquid\n\n---\nlayout: none\n---\n{\n    \"\"version\": \"https://jsonfeed.org/version/1\",\n    \"title\": {{ site.name | smartify | jsonify }},\n    {% if site.description %}\"description\": {{ site.description | smartify | jsonify }},{% endif %}\n    \"home_page_url\": \"{{ site.url }}/\",\n    \"feed_url\": \"{{ site.url }}/api/index.json\",\n    \"icon\": \"{{ site.url }}/assets/favicon/android-chrome-192x192.png\",\n    \"favicon\": \"{{ site.url }}/favicon.ico\",\n    \"author\": {\n        \"name\": \"{{ site.author }}\",\n        \"url\": \"https://alokprateek.in/\",\n        \"avatar\": \"https://alokprateek.in/avatar3.jpg\"\n    },\n    \"expired\": false,\n    \"items\": [\n           ]\n}\n\n```\n\nUnder `items` whatever existed in `index.json` before goes in, without the front matter, that remains the same.\n\nFields like `icon`, `favicon`, and `author` depend on your particular implementation, and I didn’t feel like generalizing the code by using front-matter variables rather I just pasted the values directly.\n\nSecond, you’ll have to read the spec for the full info on which fields are optional and mandatory.\n\nThat’s about it! 😊\n\nFor a final example take a look at my final JSON. And you can curl at this link [blog.alokprateek.in/api/](https://blog.alokprateek.in/api/)\n\n```liquid\n\n---\nlimit: 10\nlayout: none\n---\n{\n    \"version\": \"https://jsonfeed.org/version/1\",\n    \"title\": {{ site.name | smartify | jsonify }},\n    {% if site.description %}\"description\": {{ site.description | smartify | jsonify }},{% endif %}\n    \"home_page_url\": \"{{ site.url }}/\",\n    \"feed_url\": \"{{ site.url }}/api/index.json\",\n    \"icon\": \"{{ site.url }}/assets/favicon/android-chrome-192x192.png\",\n    \"favicon\": \"{{ site.url }}/favicon.ico\",\n    \"author\": {\n        \"name\": \"{{ site.author }}\",\n        \"url\": \"https://alokprateek.in/\",\n        \"avatar\": \"https://alokprateek.in/avatar3.jpg\"\n    },\n    \"expired\": false,\n    \"items\": [\n{% for post in site.posts limit: page.limit %}\n    {\n      \"title\": \"{{ post.title }}\",\n      \"date\"     : \"{{ post.date | date: \"%B %d, %Y\" }}\",\n      \"url\": \"{{ site.url }}{{ post.url }}\",\n      \"summary\": {{ post.excerpt | smartify | jsonify }},\n      \"content_html\": {{ post.content | jsonify }},\n      {% if post.categories %} \"categories\"  : [\n        {% for category in post.categories %} \"{{ category }}\"\n        {% if forloop.last %}{% else %},{% endif %}\n        {% endfor %}\n        ],\n      {% endif %}\n      {% if post.categories == nil %} \"categories\"  : [],  {% endif %}\n      {% if post.tags %} \"tags\"  : [\n        {% for tag in post.tags %} \"{{ tag }}\"\n        {% if forloop.last %}{% else %},{% endif %}\n        {% endfor %}\n        ]\n      {% endif %}\n      {% if post.tags == nil %} \"tags\"  : []  {% endif %}\n\n    }\n    {% unless forloop.last %},{% endunless %}\n{% endfor %}\n    ]\n}\n\n```\n\nUntil next time!\n\nCheers!🍻\n",
       "categories"  : [
         "development"
        
        
        ],
      
      
       "tags"  : [
        
        ]
      
      

    }
    ,

    {
      "title": "Plot Summary",
      "date"     : "October 17, 2016",
      "url": "https://blog.alokprateek.in/random/color-purple/",
      "summary": "<p>A book review of The Color Purple by Alice Walker.</p>\n",
      "content_html": "<p>A book review of The Color Purple by Alice Walker.</p>\n\n<h2 id=\"first-period\">First Period</h2>\n\n<p>In The Color Purple, the story is told through letters. The only sentences outside the letters are the first two: “You better not never tell nobody but God. It’d kill your mammy.” Silenced forever, the main character, fourteen year old Celie, writes letters to God. Her father has raped her, and she has two children, a girl and a boy, whom “Pa” took away from her. Celie’s mother has died and Pa is looking too much at her little sister, Nettie.\nMr. wants to marry Nettie but Pa rejects him because of the Mr.’s scandals with Shug Avery, a blues singer. Celie manages to get a picture of Shug and falls in love with her. Eventually, Mr. agrees to take Celie instead of Nettie because Pa offers him a cow.\nOnce she is in his care, Mr. beats Celie all the time. Meanwhile, Nettie runs away from Pa and comes to Mr.’s house, but when she rejects him, he throws her out. Celie advises Nettie to ask her daughter Olivia’s new “mother” for help. Nettie promises to write but her letters never arrive.\nOne day, Shug Avery comes to town, but Mr. does not take Celie to see her. Harpo, Mr.’s son, gets married to Sofia, a strong brave woman, and when he complains that Sofia does not obey him, Celie advises Harpo to beat her. Sofia finds out, and in the conversation that follows, Celie realizes she is jealous of Sofia: “You do what I can’t. Fight,” she says.</p>\n\n<h2 id=\"second-period\">Second Period</h2>\n\n<p>Shug is ill and Mr. brings her to his home. To Celie’s surprise, she calls Mr. by his first name, Albert. Celie’s love and care make Shug better; Shug starts composing a new song.\nSofia finally leaves Harpo, who turns his house into a jukejoint and asks Shug to sing. Shug invites Celie to the performance. Shug sings “A Good Man Is Hard to Find” and then her new piece, called “Celie’s Song.” Celie discovers that she is important to someone.\nBefore leaving, Shug says she will make sure Mr. never beats Celie again. She also teaches Celie to love herself. By the time Sofia returns with a new man and six children instead of five, Harpo has a little girlfriend he calls Squeak. Sofia and Squeak hit each other in the jukejoint, and finally Sofia leaves.\nThe mayor’s wife sees Sofia in town with the kids and asks Sofia to be her maid. Sofia answers “Hell no,” and hits the mayor when he protests. She is arrested, beaten and left in prison. Meanwhile, Squeak takes care of Sofia’s children. When she finds out one of Sofia’s wardens is her uncle, Squeak tries to save Sofia. She convinces the warden that working for the mayor’s wife would be a better punishment for Sofia. The warden forces Squeak to have sexual intercourse with him. When Squeak goes back home, furious and humiliated, she orders Harpo to call her Mary Agnes, her real name. Sofia starts working for the mayor’s wife, but she is treated as a slave.\nOn her next visit, Shug is married. She and Celie have missed each other, and one night, when the men are away, Celie tells Shug the story of Pa and the children. Shug kisses her, and they make love.</p>\n\n<h2 id=\"third-period\">Third Period</h2>\n\n<p>One day, Shug asks Celie about Nettie, and together they realize Mr. has been hiding Nettie’s letters. They finally recover them from Mr.’s trunk.\nUnlike Celie’s letters to God, Nettie’s letters are written in standard English. The day Nettie left, Mr. followed her and tried to rape her. She fought, and he had to give up, but he promised she would never hear from Celie again. Nettie went to see Corrine, Olivia’s new mother, and her husband, the Reverend Samuel. She also met Celie’s other child, Adam. Samuel was a member of a missionary society, and Nettie decided to go to Africa with the family. First, they went to New York, where Nettie discovered Harlem and African culture. Then, they went to England and Senegal, where Nettie saw what Europe was doing to Africa: robbing its treasures, using its peoples, and impoverishing the land.\nCelie reads Nettie’s letters and wants to kill Mr. for having hidden them. To help Celie control herself, Shug suggests that Celie make herself a pair of pants and go on reading the letters.\nWhen the missionary group arrived in Africa, the Olinkas thought Adam and Olivia were Nettie’s and Samuel’s children. They told Nettie the story about roofleaves: There had been a greedy chief who cut down much of the jungle in order to create more farmland. The plants, which provided the leaves for the roofs of the Olinkas’ houses, were destroyed, and many people died. The village began worshipping the leaves. When Nettie looked at the roof of her new house in the village, she knew she was in front of the Olinkas’ God.\nOlinka girls were not educated. Olivia was the only girl at school. Corrine, jealous and worried by the Olinkas’ impressions about her family, asked Nettie to tell the children not to call her Mama. Olivia’s only girlfriend, Tashi, could not come to school because her parents forbade it.\nAfter five years of silence, the next letter tells Celie that Adam and Olivia had discovered connections between slave stories and African stories. Tashi’s father had died, and her mother had let her go to school. A road was now near the village, and suddenly the Olinkas realized it was going to destroy their sacred place. The chief went to the coast to do something about it, but he discovered that the Olinkas’ whole territory now belonged to a rubber company.\nWhen Corrine got ill shortly afterwards, she told Nettie she thought Adam and Olivia were Nettie’s and Samuel’s kids. Though Nettie swore it was not so, Corrine was not convinced. Nettie and Samuel talked about it, and Samuel told her that Celie’s and Nettie’s real father was not the man they called “Pa”; their mother had been married before to a man who was lynched by white people. In this way, Celie is freed from the nightmare of believing her children are also her brother and sister.</p>\n\n<h2 id=\"fourth-period\">Fourth Period</h2>\n\n<p>For the first time, Celie writes a letter to Nettie. She has visited her old house with Shug and seen her Pa. Meanwhile, she goes on reading Nettie’s letters.\nNettie and Samuel tried to convince Corrine of the real story of the children. She believed them only when Nettie made her remember meeting Celie in town. Corrine smiled to them then but died soon afterwards.\n“I don’t write to God no more, I write to you (Nettie)”, says Celie in her next letter. She sees she has been praying to a white old man. Shug tells Celie she believes God is not a He or a She, but an It. It is everything, and It gets very angry if one walks by the color purple in a field and doesn’t notice it.\nShug and Celie decide to leave Mr. together with Mary Agnes, who wants to be a singer. Celie curses Mr. and tells him that everything he did to her, he did to himself. The two women go to Shug’s house in Memphis. Then, Shug travels around singing, and Celie starts Folkspants, Unlimited, a family clothing business.\nWhen Celie goes back home to see Sofia and Harpo, she finds Mr. has changed. He cooks and cleans. Now they can talk. Harpo tells Celie his father could not sleep until he sent Celie the last letters he had kept.\nThe letters say Nettie and Samuel got married in the middle of the Olinka war. The company destroyed the roofleaves. Some of the Olinkas went to the jungle to search for the mbeles, a legendary tribe. Samuel and Nettie traveled to England and in the journey, Nettie told the children their real story. They were eager to meet Celie, but Adam missed Tashi. When they got back to Africa, the Olinkas were so desperate that they had marked their children’s faces to keep their tradition alive. Tashi had the traditional scars in her cheeks.\nIn America, Celie’s stepfather dies and she inherits the house. She cleans it of its horror with a ceremony and sells her pants there. Shug goes back to Memphis. Celie is very sad and lonely, and she then hears that the ship Nettie had taken to go home was sunk by the Germans.\nBut Nettie’s letters keep arriving. Tashi, her mother, and Adam all disappeared from the village. Meanwhile, Mr. and Celie are united through heartbreak and their love for Shug. Celie discovers that Mr. loves to sew. While they work together, she tells him the Olinkas’ version of Adam and Eve’s story: Adam and Eve were the first white babies in a black world, rejected because they were different. The serpent represents black people. Whites crush this serpent when they can because they are still enraged. In time, white people will be the new serpent and colored people will crush them. The only way to stop this horror is to worship the serpent and accept that it is our relative.\nIn her last letter, Nettie tells Celie that Adam and Tashi went to a secret valley where people from different tribes lived together. When they came back, Adam wanted to marry Tashi, but she rejected him. Adam scarred himself to convince her, and then they got married.\nSofia starts working in Celie’s store. She is with Harpo again. Mr., who is now called Albert, asks Celie to marry him, but Celie prefers friendship. Shug comes back to them. Celie’s last letter in the book is to God, but this time it is Shug’s God. Celie is happy: Nettie, Samuel and the children are home at last.</p>\n\n<h1 id=\"themes\">THEMES</h1>\n\n<h2 id=\"sexism\">Sexism</h2>\n<p>Sexual relations between men and women in The Color Purple is a major theme. Alice Walker sets her story of Celie’s transformation from a passive female to an independent woman within the culture of southern black rural society from the 1920s to the 1940s. In the beginning of the story, Celie is dominated first by her father, whom she later learns is really her stepfather, then by her husband, Albert (Mr.). The catalyst for the character change in Celie is the relationship she develops with Shug Avery, her husband Albert’s mistress. Because Celie has been warned by her stepfather, Alphonso, not to tell anyone but God about how he repeatedly rapes her, she begins to write letters to God. It is through the letters that the reader develops a sense of Celie’s being, which at first is self-effacing, but eventually becomes strong and independent.\nIn the novel there are a number of role reversals that take place between men and women. Harpo, Albert’s son, tries to emulate his father and attempts to dominate his strong-willed wife, Sofia. By the end of the story, Harpo and Sofia have reversed traditional male-female roles. Harpo stays home to take care of the house, while Sofia works. Celie and Albert also reverse roles. By the end of the story, Celie is an independent businesswoman, and Albert is her assistant. Celie has also learned to speak up for herself, claiming her house when her stepfather dies. The sexual relationship between Celie and Shug further breaks with the traditional roles of passive women and dominant men that the story challenges. In the relationship between Samuel and Corrine, the missionaries who adopt Celie’s children, and later between Nettie and Samuel, Walker presents what could be called a partnership relationship between a man and woman. In these relationships, both the man and the woman share the same goals and work together to realize them. Walker uses the incident between Squeak and her white uncle, the warden at Sofia’s prison, to illustrate how sexism and racism were expressed. The warden has no qualms about raping his own niece, which reflects a southern, white, male disregard for the dignity of black women. During the period of the novel, it was a commonly held view among white males that they could do whatever they pleased with black women, a view that many black males shared as well.</p>\n\n<h2 id=\"transformation\">Transformation</h2>\n<p>Celie’s transformation from a young passive girl, who is the object of violence and cruelty from her stepfather and her husband, into an independent woman with self-esteem is at the heart of The Color Purple. While the ways in which conflicts are resolved may stretch the imagination at times, they are central to the author’s view that goodness can triumph over evil. That Celie is able to forgive Albert by the end of the story and take him in as a helper reflects Walker’s insistence on the redeeming quality of the human heart. She shows in transformed relationships that the worst cruelty committed by one person on another does not prohibit a change of heart. Her view is basically that the conditions under which human beings struggle shape their behavior. Albert had a difficult life and took out his frustrations on Celie. When Celie became self-sufficient, she could easily have turned her back on Albert, but it is not within the framework of her character to be uncharitable. In becoming independent, Celie has found happiness. Rejecting Albert would detract from her happiness. Celie’s behavior toward Albert reflects Walker’s insistence on forgiveness and contributes to the overall religious overtones of the book.</p>\n\n<h2 id=\"culture\">Culture</h2>\n<p>Cultural difference plays a significant role in The Color Purple. Walker effectively uses black folk English in Celie’s letters to express the voice of poor, black rural African Americans. Walker presents a clear picture in the book of the economic and social hardships that African Americans faced in the rural south during the early 1900s. She also presents an honest picture of the effects of racial repression. The picture Walker paints of black life is not one-sided. While Celie and Albert are tied to the land and the harsh life it represents, Nettie escapes into a black middle-class life through her missionary friends. Religion in the South played an important role in liberating many African Americans from poverty. As a spin-off for involvement with the church, literacy and education flourished. Celie is embracing a religious literacy through her letters to God, and in her letters to Nettie she comes to grips with the larger world, including Africa, outside her small community. By making the connection to Africa, Walker emphasizes the importance of African Americans’ roots.</p>\n\n<h1 id=\"construction\">CONSTRUCTION</h1>\n\n<h2 id=\"point-of-view\">Point of View</h2>\n<p>The Color Purple is written in the first person, and the voice is predominately Celie’s, but some of the letters that comprise the book are written to Celie by her sister Nettie. The story covers thirty years of Celie’s life from childhood to her maturity as an independent woman. By having Celie write in black folk English, Walker brings the reader close to the quality and rhythms of life that her characters experience. Celie’s dialect also reflects her lack of formal education. Nettie, who was formally educated, writes her letters in standard English. They are full of information that becomes a source of knowledge for Celie outside the world of her own small community.</p>\n\n<h2 id=\"structure\">Structure</h2>\n<p>The structure of The Color Purple is the series of letters Celie writes to God and to her sister Nettie. Some of the letters in the book are written by Nettie to Celie. This literary form is called the epistolary novel, a form developed in eighteenth-century England by novelists like Samuel Richardson. A major advantage of this structure is that the reader becomes intimate with the character of the letter writer. With the epistolary form, Walker was able to focus on the inner life of her main character and create a sense of intimacy that may be partly responsible for the success of the book. This technique creates a confidential reading experience. The reader has a chance to read over the character’s shoulder and look inside her. Nettie, to a great extent, escaped the cruelty that Celie experienced because she was able to leave home early. The tone of her letters to Celie contrasts sharply with Celie’s letters to God. In Nettie’s letters, there is much less intimacy. They do not contain the suffering that Celie has expressed in her letters to God. By introducing Nettie’s letters, Walker is able to shift her story from Celie’s life of despair to a life that begins to have hope. It is through the help of Shug Avery that Celie finds her hope—the letters from Nettie that Albert had hidden from her.\nBasically there are four time frames of the novel. In the first period of her life, Celie experiences the misery of poverty and cruelty at the hands of her stepfather. In the second closely-related period, Celie experiences continued cruelty from her husband Albert. In the third period, she awakens to the possibility of self-realization through her relationship with Shug and her renewed contact with her sister Nettie. Finally, Celie has realized herself and has established a life where she has control; she has found the happiness and contentment that come from self-realization. Another period, not directly a part of Celie’s life, is Nettie’s time spent in Africa. The letters from Nettie serve as a contrast to Celie’s life. They also enlarge Celie’s perspective and help to universalize her life.</p>\n\n<h2 id=\"symbolism\">Symbolism</h2>\n<p>The primary symbol of The Color Purple is found in the title, The Color Purple. The significance of the color purple is that it stands for human hope. It is a miraculous color when found in nature, and one which indicates that the feeling of hope, despite misery is a miracle of the human spirit.</p>\n",
       "categories"  : [
         "random"
        
        
        ],
      
      
       "tags"  : [
        
        ]
      
      

    }
    ,

    {
      "title": "Fascism",
      "date"     : "October 15, 2016",
      "url": "https://blog.alokprateek.in/random/fascism/",
      "summary": "<p>The Oxford English Dictionary defines fascism as: <em>“An authoritian and nationalistic right wing form of the government.”</em> It also further states that: <em>” Fascism tends to include a belief in the supremacy of one national or ethnic group, contempt for democracy, an insistence on obedience to a powerful leader and strong demagogic approach.”</em> And how many times one goes by the book? I as individual partially disagree with above definition, and believe that though they consider one national or ethnic group as supreme they might include other group or people from other group if they need their support (For e.g.: In the movie The Pianist there is group of Jews’ who help S.S. in sending other Jews to concentration camps. This is seen in scene where Spilzmann’s family is loaded to the train but Spilzmann’s Jew friend gets him away from the train and asks him to run away). This is also mentioned by Mussolini in his book on Fascism.</p>\n",
      "content_html": "<p>The Oxford English Dictionary defines fascism as: <em>“An authoritian and nationalistic right wing form of the government.”</em> It also further states that: <em>” Fascism tends to include a belief in the supremacy of one national or ethnic group, contempt for democracy, an insistence on obedience to a powerful leader and strong demagogic approach.”</em> And how many times one goes by the book? I as individual partially disagree with above definition, and believe that though they consider one national or ethnic group as supreme they might include other group or people from other group if they need their support (For e.g.: In the movie The Pianist there is group of Jews’ who help S.S. in sending other Jews to concentration camps. This is seen in scene where Spilzmann’s family is loaded to the train but Spilzmann’s Jew friend gets him away from the train and asks him to run away). This is also mentioned by Mussolini in his book on Fascism.</p>\n\n<p>Some scholars view fascism in narrow terms, and insist that the ideology was limited to Italy under Mussolini, as he was founder of National Fascist Party. This point troubled me a lot while writing on this topic for the first time. But some writers define fascism more broadly to include many movements, from Italian Fascism to contemporary neo-Nazi movements in the United States which according to me should fit under this term. I also read a very apt definition of Fascism by <strong>Kurt Vonnegut</strong> in his satirical novel <em>‘Breakfast of Champions’</em>. It states that: <em><strong>” Fascism was a fairly popular political philosophy which made sacred whatever nation and race the philosopher happened to belong to.”</strong></em>\nFascism gained popularity because many intellectuals, artists, and political thinkers in the late 19th century began to reject the philosophical emphasis on rationality and progress that had emerged from the 18th century intellectual movement in Europe known as the Enlightenment. Even today looking towards the ideas of rationality presented during Enlightenment period I doubt their correctness. Popular enthusiasm for such movements was especially strong in Germany and Italy, whose parliamentary traditions were weak as they became nations in late 18th century. Despite having fought on opposite sides, both countries emerged from the war to face political instability and a widespread feeling that the nation had been humiliated in the war and by the settlement terms of the Treaty of Versailles which heavily favored the winning sides.</p>\n\n<p>The basic characteristics of fascist movements are that they attempt revolutionary change and mainly focus on popularizing myths of national or ethnic renewal. Seen from this perspective, all forms of fascism have three common features: anticonservatism, a myth of ethnic or national renewal, and a conception of a nation in crisis. Also generally it is seen that fascist regimes have authoritian figures that are hypocrites and have different policies for different set of people. For e.g.: In the Pianist, the Jews who help S.S. in capturing other Jews are treated leniently than other Jews. Also the ‘Aryan Population’ in Poland quickly adapted to order which asked all Jews to wear Star of David on their Sleeve and shunned them whenever they came across any Jew in the streets.</p>\n\n<p>German National Socialism differed from Italian Fascism in important ways. The most important differences were Nazism’s commitment to a more extreme degree of totalitarian control, and its racist conception of the ideal national community (Aryanism). Hitler’s visionary fanaticism called for the <em>Gleichschaltung</em> (coordination) of every possible aspect of life in Germany. In the movie the Great Dictator, Adenoid Hynkel, controlled the land of Tomaina, his minions organized themselves into militarist formations to please their dictator. The vision of totalitarianism control as seen in fictional Tomania was similar to that day Germany. The totalitarianism that resulted in Germany went further than that of Italy. They ostracized races other than Aryans as they regarded them as ‘subhuman’. Italian Fascism lacked the ideological fervor to indulge in systematic ethnic cleansing on the scale seen in Germany because it didn’t have a long tradition of anti-Semitism feelings in its population unlike the latter. Although the Italian Fascist government did issue anti-Semitic laws by taking example from Germany, but did not think about mass extermination of its Jewish population. In Italy Fascism also was marked by pluralism, compromise, and inefficiency as compared to Nazism. As a result, in Fascist Italy far more areas of personal, social, and cultural life escaped the intrusion of the state than in Nazi Germany.</p>\n\n<p>Also what set them apart from other fascist movements is that they developed an ideology in the context of a modern economy and society. Even after defeat in World War I, the country was still one of the most advanced nations in the world in terms of infrastructure, government efficiency, industry, economic potential, and standards of education. Germany also had a deep sense of national pride, belonging, and roots, and a civic consciousness that stressed duty and obedience and had a long tradition of anti-Semitism and imperialism, and also respect for gifted leaders. The institution of democracy had only weak roots in Germany, and after World War I democracy was widely rejected as un-German.</p>\n\n<p>One of the new entrants to fascist states that have emerged after WWII is ISIS (Islamic State of Iraq and the Levant). ISIS is an unrecognized state in the Iraq region, is an anti-Shiaism, extremist Sunni state. The ISIS has committed exterminations of many Shias, people of other religions and people of foreign descent. It controls large parts of Middle East and has about 100, 000 fighters and all of them practice racial discrimination against other religions. The ideology of Islam in danger from western influences and laying their lives for their religion and dying as martyrs, is used as most important point in recruiting fighters. Due to racism faced by many Muslims in Western countries, many feel lost and ostracized in western world and are actively joining ranks of ISIS. As per current CIA estimate about 10,000 foreign fighters have joined ISIS since February 2014. This example shows that fascist groups are still present in modern world and are still going strong.</p>\n\n<p>On a closing note I would like to assert my thoughts on fascism and the term fascist with reference to political lexicon in JNU. I believe that fascism though is a relatively new term, as it originated in 20th century. But I still have doubts on what should I consider and what should I leave while truly defining fascism according to me. There have been many fascist movements in past three score years but each of them is distinctly different, but is called fascist movements as they are very similar to fascist movements in Germany and Italy at the time of World Wars. But if compared to each other these movements may not have a single trait in common. Also while skimming to various posters of Leftist Political parties in JNU, one can find that they refer to right winged political parties as fascist. Yeah, they say that but these right winged parties cannot be called fascists as they do not want to create a revolutionary new order in the society nor do they put forward flagrant theories to their racist views.</p>\n\n<p>And finally I hope that I have conveyed to the reader the essence of the topic and its relevance todays scenario and a wish that I write on a better and interesting topic next time around.</p>\n\n<h4 id=\"citations\">Citations</h4>\n\n<ul>\n  <li>Griffin, Roger D. “Fascism.” Microsoft® Student. Redmond, WA: ©Microsoft Corporation, 2012.</li>\n  <li>“National Socialism.” Microsoft® Student. Redmond, WA: ©Microsoft Corporation, 2012.</li>\n  <li>Mussolini, Benito. “Fascism: Doctrine and Institutions” An Italian dictator from 1922-1943. Under Public domain.</li>\n  <li>Vonnegut, Kurt. “Breakfast of Champions”. ©Penguin Press Inc., 2003.</li>\n  <li>Hornby, A.S. “The Oxford Unabridged Dictionary of Current English”. ©Oxford University Press, 2011.</li>\n  <li>Arendt, Hannah. “The Origins of Totalitarianism”. Harcourt, 1951. Rev ed. P. Smith, 1983. Definitive study of totalitarian movements.</li>\n  <li>The Department of Special Collections within the University of Wisconsin-Madison’s Memorial Library. “Italian Life under Fascism”. https://www.library.wisc.edu/libraries/dpf/Fascism/Home.html</li>\n  <li>Eatwell, Roger. “Fascism: A History”. ©Penguin, 1997. Overview of the history of fascism.</li>\n  <li>Fischer, Klaus P. “Nazi Germany: A New History”. ©Continuum, 1995.</li>\n  <li>Associated Press. “On ISIS”. Published in the Hindustan Times (21st October, 2014).</li>\n  <li>Leech, Robb. “Don’t blame my brother for becoming a jihadi”. The Guardian. Published in the Hindustan Times (25th October, 2014).</li>\n</ul>\n",
       "categories"  : [
         "random"
        
        
        ],
      
      
       "tags"  : [
        
        ]
      
      

    }
    ,

    {
      "title": "Learn Anything in 4 Steps",
      "date"     : "July 26, 2016",
      "url": "https://blog.alokprateek.in/random/feynman-tecnique/",
      "summary": "<p>With the Feynman Technique, you can learn anything by teaching someone else a topic in simple terms. This will allow you to quickly pinpoint the holes in your knowledge. After following these four steps, you’ll be able to understand concepts more deeply and better retain the information.</p>\n",
      "content_html": "<p>With the Feynman Technique, you can learn anything by teaching someone else a topic in simple terms. This will allow you to quickly pinpoint the holes in your knowledge. After following these four steps, you’ll be able to understand concepts more deeply and better retain the information.</p>\n\n<h2 id=\"keep-it-simple-scientist\">Keep It Simple, Scientist</h2>\n\n<p>The Feynman Technique is a mental model that was coined by Nobel-prize winning physicist Richard Feynman. Known as the “<strong>Great Explainer</strong>,” Feynman was revered for his ability to clearly illustrate dense topics like quantum physics for virtually anybody. In “<em>Feynman’s Lost Lecture: The Motion of Planets Around the Sun</em>,” David Goodstein writes that Feynman prided himself on being able to explain the most complex ideas in the simplest terms.</p>\n\n<p>Goodstein once asked Feynman to explain why “spin one-half particles obey Fermi-Dirac.” Feynman replied that he’d prepare a freshman lecture on it, but then he came back a few days later empty-handed. “I couldn’t reduce it to freshman level,” he admitted to Goodstein. “That means we don’t really understand it.”</p>\n\n<p>That is to say, if Feynman couldn’t explain something in simple terms, there was a problem with the information, not with Feynman’s teaching ability.</p>\n\n<h2 id=\"the-feynman-technique\">The Feynman Technique</h2>\n\n<h3 id=\"first-step-write-it-out-for-a-child\">First Step: Write it out for a child</h3>\n\n<p>Take out a blank sheet of paper. At the top write the subject you want to learn. Now write out everything you know about the subject you want to understand as if you were teaching it to a child. Not your smart adult friend, but rather an 12-year-old who has just enough vocabulary and attention span to understand basic concepts and relationships.</p>\n\n<p>It turns out that one of the ways we trick ourselves is that we use complicated vocabulary and jargon and it masks our lack of understanding.</p>\n\n<p>When you write out an idea from start to finish in simple language that a child can understand, you force yourself to understand the concept at a deeper level and simplify relationships and connections between ideas.</p>\n\n<p>Some of this will be easy. These are the places where you have a clear understanding of the subject. At other points, you will struggle. These are the points where you have some gaps in your understanding.</p>\n\n<h3 id=\"second-step-review-it\">Second Step: Review it</h3>\n\n<p>Only when you encounter gaps in your knowledge—where you’re forgetting something important, are not able to explain it, or simply have trouble thinking of how variables interact—can you really start learning.</p>\n\n<p>Now that you know where you got stuck, go back to the source material and re-learn it until you can explain it in basic terms. Only when you can explain your understanding without jargon and in simple terms can you demonstrate your understanding. This is the work required to learn and skipping it leads to the illusion of knowledge.</p>\n\n<p>Identifying the boundaries of your understanding also limits the mistakes you’re liable to make and increases your chance of success when applying knowledge.</p>\n\n<h3 id=\"third-step-organize-and-simplify\">Third Step: Organize and Simplify</h3>\n\n<p>Now you have a set of hand-crafted notes. Review them to make sure you didn’t mistakenly borrow any of the jargon from the source material. Organize them into a simple narrative that you can tell. Read it out loud. If the explanation isn’t simple or sounds confusing that’s a good indication that your understanding in that area still needs some work.</p>\n\n<p>If you follow this approach over and over you will end up with a binder full of pages on different subjects. If you take some time twice a year to go through this binder and update your knowledge you will keep your knowledge.</p>\n\n<h3 id=\"fourth-step-optional-transmit\">Fourth Step (Optional): Transmit</h3>\n\n<p>If you really want to be sure of your understanding, run it past someone (ideally who knows little of the subject –or find that 12-year-old!). The ultimate test of your knowledge will your capacity to convey it to another.</p>\n\n<h2 id=\"the-perks-\">The Perks 😀</h2>\n\n<p>Not only is the Feynman Technique a wonderful recipe for learning, but it’s also a window into a different way of thinking that allows you to tear ideas apart and reconstruct them from the ground up.</p>\n\n<p>When you’re having a conversation with someone and they start using words or relationships that you don’t understand, ask them to explain it to you like you’re 12. Not only will you supercharge your own learning, you’ll supercharge theirs. Importantly, approaching problems in this way allows you to understand when others don’t know what they are talking about.</p>\n",
       "categories"  : [
         "random"
        
        
        ],
      
      
       "tags"  : [
        
        ]
      
      

    }
    

    ]
}

Until next time!

Cheers!🍻

Leave a comment