Skip to content

Instantly share code, notes, and snippets.

#define stl_foreach(v, c) for (typeof(c.begin()) v = c.begin(); v != c.end(); ++v)
[Version]
Signature="$Windows NT$"
[DefaultInstall]
AddReg=SublimeText3
[SublimeText3]
hkcr,"*\\shell\\SublimeText3",,,"Edit With Sublime Text"
hkcr,"*\\shell\\SublimeText3","Icon",0x20000,"%1%\sublime_text.exe, 0"
hkcr,"*\\shell\\SublimeText3\\command",,,"""%1%\sublime_text.exe"" ""%%1"" %%*"
; Save this code to inf file and install it
;
; "CMD Prompt Here" PowerToy
;
; Copyright 1996 Microsoft Corporation
;
[version]
signature="$CHICAGO$"
[CmdHereInstall]
#import <objc/objc-runtime.h>
#define LOAD_CLASS(name) LOAD_CLASS_BY_NAME(#name)
#if __OBJC2__
#if TARGET_RT_64_BIT
#define LOAD_CLASS_BY_NAME(name) \
asm(\
".section __DATA,__objc_classrefs,regular,no_dead_strip\n"\
".align 3\n"\
"L_OBJC_CLASS_"name":\n"\
function join { local IFS="$1"; shift; echo "$*"; }
@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) {
@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 / 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(%)
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)
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