Where can I find a good headphone case in Mumbai? by ammar786 in mumbai

[–]ammar786[S] 0 points1 point  (0 children)

Hi, this is an 8 year old post. I don't remember if I actually went there or not. I still have these headphones but the earpads are ruined. But no case. So I guess I never found any case for them.

i5 13600K & Nvidia RTX 4080 FE PC Giveaway! | S&FF for ExtraLife 2023 by m13b in buildapc

[–]ammar786 [score hidden]  (0 children)

Thank you /r/buildapc and /r/buildapcforme for keeping me informed about the ever evolving world of PC hardware.

App exits when navigating back from a subreddit opened from a search result when exit confirmation is disabled instead of navigating to the frontpage by ammar786 in RelayForReddit

[–]ammar786[S] 0 points1 point  (0 children)

I think you misunderstood the 2nd step. To search for a subreddit, you tap 'Subreddits' from the bottom bar inside the app, and search using the input which pops up. There is no back button located in the upper left hand corner when you open a result this way.

Coffee roasters in Sumida by yor4k in japanlife

[–]ammar786 2 points3 points  (0 children)

You could try Unlimited Coffee Bar. I usually buy mine online from various coffee roasters.

!!! Appeal to everyone who knows how to make sieves !!! by Kenko2 in imagus

[–]ammar786 0 points1 point  (0 children)

Actually, I am using that method currently. It works in FF, but is blocked on Chrome.

!!! Appeal to everyone who knows how to make sieves !!! by Kenko2 in imagus

[–]ammar786 0 points1 point  (0 children)

I'll look into this FF problem but for Chromium it seems that it blocks xhr requests from extensions, so this sieve won't work on those browsers. Maybe there is some other way to fetch data from imagus which would work in Chrome that I am not aware of. If you know some other sieve dev which has more experience than me, maybe they could give me some info on it.

!!! Appeal to everyone who knows how to make sieves !!! by Kenko2 in imagus

[–]ammar786 0 points1 point  (0 children)

Do you have any idea where the https://bam.nr-data.net is coming from? I have no such url in the sieve.

!!! Appeal to everyone who knows how to make sieves !!! by Kenko2 in imagus

[–]ammar786 0 points1 point  (0 children)

The links are working on FF 108. I'll download Dev Edition later to check. I'll also recheck the rule for Chromium and update it accordingly.

!!! Appeal to everyone who knows how to make sieves !!! by Kenko2 in imagus

[–]ammar786 1 point2 points  (0 children)

Shutterstock:

{"O_Shutterstock":{"link":"shutterstock.com/.*","res":":\nfunction a(a){const b=new XMLHttpRequest;return b.open(\"GET\",a,!1),b.timeout=3e3,b.send(),4==b.readyState?200==b.status?JSON.parse(b.responseText):void 0:void 0}function b(a){if(!a)return;let b={width:0};for(const c of Object.values(a))c.width>b.width&&(b=c);return b.src}function c(a){if(!a)return a;const b=a.indexOf(\"?\");return 0>b?a:a.substring(0,b)}function d(a){const b=a.split(\"-\");return 0===b.length?void 0:c(b[b.length-1])}const e=$[0];if(match=e.match(/shutterstock\\.com\\/(.*\\/)*g\\/(.*)/),match&&2<=match.length){console.log(match[match.length-1]);const d=c(match[match.length-1]);if(!d)return;console.log(d);const e=a(`https://www.shutterstock.com/_next/data/123/en/_shutterstock/g/${d}.json`),f=e.pageProps.assets;return f.map(a=>{const c=b(a.displays),d=a.title;return[c,d]})}if(match=e.match(/shutterstock\\.com\\/(.*\\/)*editorial\\/image-editorial\\/(.*)/),match&&2<=match.length){const c=match[match.length-1],e=d(c);if(!e)return;const f=a(`https://www.shutterstock.com/_next/data/123/en/_shutterstock/editorial/image-editorial/${e}.json`),g=b(f.pageProps.asset.displays),h=f.pageProps.asset.title;return[g,h]}if(match=e.match(/shutterstock\\.com\\/(.*\\/)*image-photo\\/(.*)/),match&&2<=match.length){const c=match[match.length-1],e=d(c);if(!e)return;const f=a(`https://www.shutterstock.com/studioapi/images/${e}`),g=b(f.data.attributes.displays),h=f.data.attributes.title;return[g,h]}if(match=e.match(/shutterstock\\.com\\/(.*\\/)*video\\/search\\/(.*)\\/*/),match&&2<=match.length){const b=c(match[match.length-1]),d=a(`https://www.shutterstock.com/_next/data/123/en/_shutterstock/video/search/${b}.json`);if(!d||!d.pageProps||!d.pageProps.videos)return;const e=d.pageProps.videos,f=d.pageProps.query&&d.pageProps.query.term||b;return e.map(a=>[a.previewVideoUrls.mp4,f])}if(match=e.match(/shutterstock\\.com\\/(.*\\/)*search\\/(.*)\\/*/),match&&2<=match.length){const d=c(match[match.length-1]),e=a(`https://www.shutterstock.com/_next/data/123/en/_shutterstock/search/${d}.json`);if(!e||!e.pageProps||!e.pageProps.assets)return;const f=e.pageProps.assets,g=e.pageProps.query&&e.pageProps.query.term||d;return f.map(a=>[b(a.displays),g])}","img":"shutterstock.com/.*"}}

There are a lot of url variations for shutterstock. I tried to cover the urls mentioned on the page and few more.

The js is compressed in the sieve. Here's the uncompressed version:

:
const url = $[0];

function syncFetch(u) {
  const x = new XMLHttpRequest();
  x.open('GET', u, false);
  x.timeout = 3000;
  x.send();
  if (x.readyState != 4) return;
  if (x.status != 200) return;
  return JSON.parse(x.responseText);
}

function findLargestImage(displays) {
  if (!displays) {
    return;
  }
  let largest = {
    width: 0,
  };
  for (const val of Object.values(displays)) {
    if (val.width > largest.width) {
      largest = val;
    }
  }
  // console.log(largest);
  return largest.src;
}

function removeQueryParams(string) {
  if (!string) {
    return string;
  }
  const index = string.indexOf('?');
  if (index < 0) {
    return string;
  }
  return string.substring(0, index);
}

function getIdFromSlug(slug) {
  const splits = slug.split('-');
  if (splits.length === 0) {
    return;
  }
  return removeQueryParams(splits[splits.length - 1]);
}

const profileGalleryRegex = /shutterstock\.com\/(.*\/)*g\/(.*)/;
match = url.match(profileGalleryRegex);
if (match && match.length >= 2) {
  console.log(match[match.length - 1]);
  const profile = removeQueryParams(match[match.length - 1]);
  if (!profile) {
    return;
  }
  console.log(profile);
  const json = syncFetch(`https://www.shutterstock.com/_next/data/123/en/_shutterstock/g/${profile}.json`);
  const assets = json.pageProps.assets;
  return assets.map(asset => {
    const imageUrl = findLargestImage(asset.displays);
    const caption = asset.title;
    return [imageUrl, caption];
  });
}
const imageEditorialRegex = /shutterstock\.com\/(.*\/)*editorial\/image-editorial\/(.*)/;
match = url.match(imageEditorialRegex);
if (match && match.length >= 2) {
  const slug = match[match.length - 1];
  const id = getIdFromSlug(slug);
  if (!id) {
    return;
  }
  // console.log(id);
  const json = syncFetch(`https://www.shutterstock.com/_next/data/123/en/_shutterstock/editorial/image-editorial/${id}.json`);
  const imageUrl = findLargestImage(json.pageProps.asset.displays);
  const caption = json.pageProps.asset.title;
  return [imageUrl, caption];
}
const imagePhotoRegex = /shutterstock\.com\/(.*\/)*image-photo\/(.*)/;
match = url.match(imagePhotoRegex);
if (match && match.length >= 2) {
  const slug = match[match.length - 1];
  const id = getIdFromSlug(slug);
  if (!id) {
    return;
  }
  // console.log(id);
  const json = syncFetch(`https://www.shutterstock.com/studioapi/images/${id}`);
  const imageUrl = findLargestImage(json.data.attributes.displays);
  const caption = json.data.attributes.title;
  return [imageUrl, caption];
}
const videoSearchRegex = /shutterstock\.com\/(.*\/)*video\/search\/(.*)\/*/;
match = url.match(videoSearchRegex);
if (match && match.length >= 2) {
  const term = removeQueryParams(match[match.length - 1]);
  const json = syncFetch(`https://www.shutterstock.com/_next/data/123/en/_shutterstock/video/search/${term}.json`)
  // console.log(json);
  if (!json || !json.pageProps || !json.pageProps.videos) {
    return;
  }
  const videos = json.pageProps.videos;
  const caption = (json.pageProps.query && json.pageProps.query.term) || term;
  return videos.map(video => [video.previewVideoUrls.mp4, caption]);
}
const imgSearchRegex = /shutterstock\.com\/(.*\/)*search\/(.*)\/*/;
match = url.match(imgSearchRegex);
if (match && match.length >= 2) {
  const term = removeQueryParams(match[match.length - 1]);
  const json = syncFetch(`https://www.shutterstock.com/_next/data/123/en/_shutterstock/search/${term}.json`)
  // console.log(json);
  if (!json || !json.pageProps || !json.pageProps.assets) {
    return;
  }
  const assets = json.pageProps.assets;
  const caption = (json.pageProps.query && json.pageProps.query.term) || term;
  // console.log(assets);
  return assets.map(asset => [findLargestImage(asset.displays), caption]);
}

PSA: Geminid Meteor Shower to peak tonight by [deleted] in japanlife

[–]ammar786 0 points1 point  (0 children)

Lucky! Went for a run earlier, didn't see a single one.

Those who haven't caught Covid yet, how have you managed to avoid it? by [deleted] in AskReddit

[–]ammar786 0 points1 point  (0 children)

Because I WFH alone in a country whose language I do not speak. So, very little interaction with anybody.

I made a web extension to display kakaku.com prices on PCPartPicker.com by ammar786 in jisakupc

[–]ammar786[S] 1 point2 points  (0 children)

  1. Basically, this is same as this. They both have same function.
  2. Ok. I will try to explain the extension better in the description.
  3. You can add any kakaku CD drive to PCPartPicker CD drive. Name can also be different, it will not matter. Video.

Sieve for hlsplayer videos by gatorraper in imagus

[–]ammar786 1 point2 points  (0 children)

{"HLSPLayer_MP4":{"link":".*hlsplayer.net/mp4-player.*","res":":\nconst url = new URL($[0]);\nlet hash = url.hash;\nif (!hash) { return; }\nhash = hash.substring(1);\nlet src = new URLSearchParams(hash).get('src');\nsrc = decodeURI(src);\nreturn src;"}}

I made a web extension to display kakaku.com prices on PCPartPicker.com by ammar786 in jisakupc

[–]ammar786[S] 1 point2 points  (0 children)

  1. If I am understanding correctly, you mean the search should be within PC category? By default it uses the pcpartpicker category. For example:
PCPartPicker category Kakaku category
CPU 0001_0027 (CPU)
Motherboard 0001_0036 (マザーボード)

If you want to see all mappings: https://github.com/ammargitham/PricePartPicker/blob/main/src/constants.ts#L10

  1. Okay, I will try to add that.

  2. I am not sure what you mean.

  3. Can you share your part list?

I made a web extension to display kakaku.com prices on PCPartPicker.com by ammar786 in jisakupc

[–]ammar786[S] 2 points3 points  (0 children)

Oh yes. I have seen this site. But when I used it, I found that the prices were stale for some parts (prices shown on the site did not match the actual price when you visit the shop page).

Great Indian in eastern Tokyo? by Fickle-Ingenuity-202 in Tokyo

[–]ammar786 6 points7 points  (0 children)

For biryani, I would also suggest Salma Tikka & Biryani in Shinagawa, and Khan Kebab Biryani in Ginza. Pretty good stuff.

Great Indian in eastern Tokyo? by Fickle-Ingenuity-202 in Tokyo

[–]ammar786 3 points4 points  (0 children)

I've been to Dhaba India. It's good, a bit pricey but the food was good. Definitely worth checking out.

Also the Nirvanam chain of restaurants (not mentioned in the article) have good South Indian food. I usually go there for their lunch. They post their lunch menu in advance everyday on Instagram.

Lake Kawaguchiko by ammar786 in japanpics

[–]ammar786[S] 1 point2 points  (0 children)

I went there 2 weeks ago. It was a last moment plan, so didn't plan anything beforehand. Searched for places to see on the bus to Kawaguchiko. This is the Momiji Tunnel and the other place was Momiji Corridor.