Skip to content

Instantly share code, notes, and snippets.

View mohnkhan's full-sized avatar
🎯
Focusing on Artificial Intelligence powered Automation

Mohiuddin Khan Inamdar mohnkhan

🎯
Focusing on Artificial Intelligence powered Automation
View GitHub Profile
@mohnkhan
mohnkhan / LogitechF310_Macbook.MD
Created March 24, 2024 15:25 — forked from jackblk/LogitechF310_Macbook.MD
Getting Logitech F310 to work with Macbook USB-C port

Connect & use Logitech F310 with Macbook

Since my Macbook Pro only has USB-C port, I used an USB-A to USB-C adapter to connect my F310 to it, but it does not work (pressing MODE button does not turn on the LED).

How to

To make it work:

  • Disconnect F310 from Mac
  • On F310: switch X-input to D-input
  • Hold Logitech button (in the middle)
  • Connect F310 to Mac via adapter, now you can release the Logitech button.
@mohnkhan
mohnkhan / gist:25f0f89ddda98c281d820a3010c50c62
Created October 20, 2020 14:48 — forked from paulirish/gist:5558557
a brief history of detecting local storage

A timeline of the last four years of detecting good old window.localStorage.


Jan Lenhart, bless his heart contributed the first patch for support:

October 2009: 5059daa

@mohnkhan
mohnkhan / nginx.conf
Created December 20, 2018 20:29 — forked from Stanback/nginx.conf
Example Nginx configuration for adding cross-origin resource sharing (CORS) support to reverse proxied APIs
#
# CORS header support
#
# One way to use this is by placing it into a file called "cors_support"
# under your Nginx configuration directory and placing the following
# statement inside your **location** block(s):
#
# include cors_support;
#
# As of Nginx 1.7.5, add_header supports an "always" parameter which
@mohnkhan
mohnkhan / postgres_queries_and_commands.sql
Created January 27, 2016 16:20 — forked from rgreenjr/postgres_queries_and_commands.sql
Useful PostgreSQL Queries and Commands
-- show running queries (pre 9.2)
SELECT procpid, age(query_start, clock_timestamp()), usename, current_query
FROM pg_stat_activity
WHERE current_query != '<IDLE>' AND current_query NOT ILIKE '%pg_stat_activity%'
ORDER BY query_start desc;
-- show running queries (9.2)
SELECT pid, age(query_start, clock_timestamp()), usename, query
FROM pg_stat_activity
WHERE query != '<IDLE>' AND query NOT ILIKE '%pg_stat_activity%'