Skip to content

Instantly share code, notes, and snippets.

View imtiaz-emu's full-sized avatar
Patience is the key

Imtiaz Hossain Emu imtiaz-emu

Patience is the key
  • Ørsted
  • Kuala Lumpur, Malaysia
View GitHub Profile
This file has been truncated, but you can view the full file.
[
{
"name": "Engineering Institute of Technology",
"domains": ["student.eit.edu.au"],
"web_pages": ["https://www.eit.edu.au/"],
"country": "Australia",
"alpha_two_code": "AU",
"state-province": null
},
{
[
{
"id": 149565,
"name": "Tutu",
"state_name": "Saint Thomas",
"country_code": "VI",
"country_name": "Virgin Islands (US)"
},
{
"id": 149566,
This file has been truncated, but you can view the full file.
[
{
"id": 18824,
"name": "Zürich (Kreis 12) / Auzelg",
"state_name": "Zürich",
"country_code": "CH",
"country_name": "Switzerland"
},
{
"id": 18825,
This file has been truncated, but you can view the full file.
[
{
"id": 86492,
"name": "Jakubów",
"state_name": "Mazovia",
"country_code": "PL",
"country_name": "Poland"
},
{
"id": 86512,
This file has been truncated, but you can view the full file.
[
{
"id": 136404,
"name": "Bulzi",
"state_name": "Sardinia",
"country_code": "IT",
"country_name": "Italy"
},
{
"id": 136411,
This file has been truncated, but you can view the full file.
[
{
"id": 46667,
"name": "Sainte-Catherine",
"state_name": "Hauts-de-France",
"country_code": "FR",
"country_name": "France"
},
{
"id": 46691,
This file has been truncated, but you can view the full file.
[
{
"id": 52,
"name": "Ashkāsham",
"state_name": "Badakhshan",
"country_code": "AF",
"country_name": "Afghanistan"
},
{
"id": 68,
[
{
"flags": {
"png": "https://flagcdn.com/w320/gd.png",
"svg": "https://flagcdn.com/gd.svg",
"alt": "The flag of Grenada features a large central rectangular area surrounded by a red border, with three five-pointed yellow stars centered on the top and bottom borders. The central rectangle is divided diagonally into four alternating triangular areas of yellow at the top and bottom and green on the hoist and fly sides, and a five-pointed yellow star on a red circle is superimposed at its center. A symbolic nutmeg pod is situated on the green hoist-side triangle."
},
"cca2": "GD",
"cca3": "GRD",
"idd": {
@imtiaz-emu
imtiaz-emu / data_extractor.rb
Last active February 16, 2021 05:15
Extract Data from a JSON (Ruby)
require 'active_support/core_ext/hash'
# Input: 'extra:[1:main:[5:provider]]'
# Output: ['extra', 1, 'main', 5, 'provider']
def macro_key_parser(str, keys = [])
first_key = str
first_key, second_key = str.split(':', 2) if first_key[0] != '['
if first_key[0] != '['
keys << first_key.strip
macro_key_parser(second_key, keys)
@imtiaz-emu
imtiaz-emu / smartApiAdGenRules.md
Last active January 5, 2021 05:21
SmartApi with Ad Generation Rules

SmartAPI: Let's say we already configured SmartAPI for fetching data from any weather API. Now we've two configurations:

Config 1:

Now we uploaded the feed inside smartTag and Add Filters:

  • AND Logic, selectors_data[city] contains 'Rome'
  • AND Logic, selectors_data[city] contains 'Singapore'

That means only 'Rome' and 'Singapore' city weather will be fetch from the API.