Skip to content

Instantly share code, notes, and snippets.

@yudenzel
yudenzel / VsCode.INF
Last active September 4, 2018 12:38
VsCode.INF
; Save this code to inf file and install it
;
; "Sublime Text Context Menu"
;
; Copyright 1996 Microsoft Corporation
;
[version]
signature="$Windows NT$"
[VsCodeInstall]
@yudenzel
yudenzel / lsof.sh
Last active May 24, 2019 09:01
Bash script to list opened files when lsof command not available
#!/usr/bin/env bash
declare -a SEARCH_PATHS
SEARCH_PATHS[1]=/proc/*
PROC_INDEX=1
while [[ $# -gt 1 ]]; do
case "${1}" in
-p | --pid) SEARCH_PATHS[$PROC_INDEX]="/proc/${2}"; PROC_INDEX=$((PROC_INDEX + 1)); shift 2 ;;
*) ;;
@yudenzel
yudenzel / SublimeText.Inf
Last active September 4, 2018 12:38
SublimeText.Inf
; Save this code to inf file and install it
;
; "Sublime Text Context Menu"
;
; Copyright 1996 Microsoft Corporation
;
[version]
signature="$Windows NT$"
[SublimeTextInstall]
Option Explicit
Public Sub AutoFitSelection()
Dim theSelection As Range
Set theSelection = Application.Selection
Call AutoFitCells(Application.Selection)
End Sub
Public Sub AutoFitCells(oRange As Range)
Dim tHeight As Integer
Option Explicit
'Convert binary to chars
Function ConvertToKey(Key)
Const KeyOffset = 52
Dim isWin10, Maps, i, j, Current, KeyOutput, Last, keypart1, insert
'Check if OS is Windows 10
isWin10 = (Key(66) \ 6) And 1
Key(66) = (Key(66) And &HF7) Or ((isWin10 And 2) * 4)
@yudenzel
yudenzel / fps.sh
Created October 13, 2017 06:53
Android Shell Script To Get Android FPS
#!/system/bin/sh
function show_help() {
echo "
Usage: sh fps.sh [ -t target_FPS ] [ -w monitor_window ] [ -k KPI ] [ -f csv_path ] [ -h ]
Show: FU(s) LU(s) Date FPS Frames jank MFS(ms) OKT SS(%)
@yudenzel
yudenzel / Log.java
Last active November 17, 2017 17:01
Simple log utils that log message info file.
import java.io.File;
import java.io.FileDescriptor;
import java.io.IOException;
import java.io.FileNotFoundException;
import java.lang.Thread;
import java.util.Date;
public class Log {
@yudenzel
yudenzel / FileOutputStream.java
Created September 27, 2017 11:43
FileOutputStream that implements the flush methods.
static class FileOutputStream extends java.io.FileOutputStream {
public FileOutputStream(File file) throws FileNotFoundException {
super(file, false);
}
public FileOutputStream(File file, boolean append) throws FileNotFoundException {
super(file, append);
}
public FileOutputStream(FileDescriptor fd) {
function join { local IFS="$1"; shift; echo "$*"; }