Skip to content

Instantly share code, notes, and snippets.

View amirji's full-sized avatar

Amir Najafgholi amirji

View GitHub Profile
// Java program for implementation of Bubble Sort
class BubbleSort
{
void bubbleSort(int arr[])
{
int n = arr.length;
for (int i = 0; i < n-1; i++)
for (int j = 0; j < n-i-1; j++)
if (arr[j] > arr[j+1])
{
@amirji
amirji / acc.java
Created August 20, 2019 12:06
config accessibility dynamically
public void onServiceConnected() {
String defaultSettingPkg = querySettingPkgName();
info.packageNames = new String[] {defaultSettingPkg};
this.setServiceInfo(info);
}
private String querySettingPkgName() {
Intent intent = new Intent(android.provider.Settings.ACTION_SETTINGS);
List<ResolveInfo> resolveInfos = getPackageManager().queryIntentActivities(intent, PackageManager.MATCH_DEFAULT_ONLY);
if (resolveInfos == null || resolveInfos.size() == 0) {

Keybase proof

I hereby claim:

  • I am amirji on github.
  • I am amirji (https://keybase.io/amirji) on keybase.
  • I have a public key ASAbPdCDSpKkNDKsC86rsiAlf5msNTA6QSUkRVPBKWPSsAo

To claim this, I am signing this object:

@amirji
amirji / ffmpeg_commands
Created October 20, 2017 20:35
Some useful ffmpeg commands
*Lowest latency stream player:*
ffplay -fflags nobuffer -flags low_delay -framedrop -strict experimental rtp://127.0.0.1:5004
*Capturing audio from speakers and video from desktop command, before use should install this: https://github.com/rdp/virtual-audio-capture-grabber-device*
ffmpeg -video_size 1280x1024 -framerate 30 -f gdigrab -i desktop -f dshow -i audio="virtual-audio-capturer" -c:v libx264 -qp 0 -preset ultrafast capture.mkv
@amirji
amirji / cmd
Created June 13, 2017 08:22
ffmpeg commands
ffmpeg -f gdigrab -framerate 30 -i desktop -f dshow -i audio="Microphone (2- HD Webcam C270)" output.mp4
ffmpeg.exe -f gdigrab -i desktop -framerate 15 -video_size 1100x800 -vcodec libx264 -pix_fmt yuv420p -preset ultrafast new-output-video-file.mp4
@amirji
amirji / .spacemacs
Last active December 24, 2017 16:25
;; -*- mode: emacs-lisp -*-
;; This file is loaded by Spacemacs at startup.
;; It must be stored in your home directory.
(defun dotspacemacs/layers ()
"Configuration Layers declaration.
You should not put any user code in this function besides modifying the variable
values."
(setq-default
;; Base distribution to use. This is a layer contained in the directory