Skip to content

Instantly share code, notes, and snippets.

View arahmanali's full-sized avatar
💭
Travelling is an ultimate thing to heal yourself

A Rahman Ali arahmanali

💭
Travelling is an ultimate thing to heal yourself
View GitHub Profile
@arahmanali
arahmanali / change-codec.md
Created July 25, 2022 17:22 — forked from dvf/change-codec.md
Enable High Quality mode on your headphones (Updated for macOS Catalina)

If you're using a high-end bluetooth headset on your Macbook Pro it's likely your mac is using an audio codec which favors battery efficiency over high quality. This results in a drastic degradation of sound, the SBC codec is the likely culprit, read more about it here.

Find out what codec you're using

  1. Play a song on your headphones
  2. Option (⌥) click the Bluetooth button at the top of your screen Inspect the Bluetooth Coded
  3. If you're using AAC or aptX, you can stop here—those are the highest quality codecs.

Change your codec to AAC or aptX

# package used in this gist: pyca/cryptography
# Step 1: Generating a key
from cryptography.hazmat.backends import default_backend
from cryptography.hazmat.primitives.asymmetric import rsa
private_key = rsa.generate_private_key(
public_exponent=65537,
key_size=2048,
backend=default_backend()
)
public_key = private_key.public_key()
@arahmanali
arahmanali / react-native-prevent-screenshot-android
Created July 7, 2019 19:29
React Native Prevent Screenshot In Android - Update MainActivity.java
package com.stopscreenshotapp;
import com.facebook.react.ReactActivity;
import android.os.Bundle;
import android.view.WindowManager;
public class MainActivity extends ReactActivity {
/**
@arahmanali
arahmanali / index.ios.js
Created February 13, 2019 11:58 — forked from Jpoliachik/index.ios.js
ReactNative LayoutAnimation Example
'use strict';
import React, {
AppRegistry,
Component,
StyleSheet,
Text,
View,
TouchableOpacity,
LayoutAnimation,
} from 'react-native';
@arahmanali
arahmanali / m3u8.md
Created October 18, 2018 17:11 — forked from primaryobjects/m3u8.md
How to download m3u8 and ts video movie streams.

m3u8 Downloading

  1. Open Chrome Developer tools and click the Network tab.
  2. Navigate to the page with the video and get it to start playing.
  3. Filter the list of files to "m3u8".
  4. Find master.m3u8 or index.m3u8 and click on it.
  5. Save the file to disk and look inside it.
  6. If the file contains a single m3u8 master url, copy that one instead.
  7. Run the program m3u8x.
  8. Paste the same m3u8 url in both textboxes (URL and Quality URL) and click "Headers" and set the referral url and user-agent from the request as found in Chrome.
@arahmanali
arahmanali / dataURItoBlob.js
Created September 21, 2017 08:02 — forked from davoclavo/dataURItoBlob.js
Convert dataURI to Blob so large images do not crash the browser. Based on: http://stackoverflow.com/questions/10412299 and http://stackoverflow.com/questions/6850276
/*
The MIT License (MIT)
Copyright (c) 2016 David Gomez-Urquiza
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
@arahmanali
arahmanali / index.html
Last active July 23, 2017 08:19
RxJs Basic Example // source http://jsbin.com/cihibak
<!DOCTYPE html>
<html>
<head>
<meta name="description" content="[add your bin description]">
<meta charset="utf-8">
<meta name="viewport" content="width=device-width">
<title>RxJs Basic Example</title>
</head>
<body>
<button>Click me</button>
@arahmanali
arahmanali / download_egghead_videos.md
Created January 15, 2017 16:03 — forked from ldong/download_egghead_videos.md
download egghead videos

Download videos from egghead

Go to the egghead website, i.e. Building a React.js App

run

$.each($('h4 a'), function(index, video){
  console.log(video.href);
});
@arahmanali
arahmanali / NodeJs-Modules-R&D.txt
Last active June 29, 2016 03:38
NodeJs for Queues / Cron Jobs / Clusters / ORMs
Nodejs for Queues:
=================
https://github.com/caolan/async
https://www.npmjs.com/package/queue
https://github.com/Automattic/kue
https://github.com/OptimalBits/bull
https://github.com/twitter-archive/kestrel
https://github.com/nullobject/bokeh
https://github.com/NodeRedis/node_redis