Skip to content

Instantly share code, notes, and snippets.

Return-Path: <transfusian@gmail.com>
X-Original-To: transfusion@hikki.transfusion.eu.org
Delivered-To: transfusion@hikki.transfusion.eu.org
Received: from mail-lf1-x12e.google.com (mail-lf1-x12e.google.com [IPv6:2a00:1450:4864:20::12e])
by hikki.transfusion.eu.org (Postfix) with ESMTPS id DFB9523347
for <transfusion@hikki.transfusion.eu.org>; Sat, 26 Jan 2019 07:19:42 +0000 (UTC)
Received: by mail-lf1-x12e.google.com with SMTP id v5so8499922lfe.7
for <transfusion@hikki.transfusion.eu.org>; Fri, 25 Jan 2019 23:19:42 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
d=gmail.com; s=20161025;
@Transfusion
Transfusion / AppDelegate.m
Created January 7, 2019 02:30
Disable screenshot and blank screen upon App defocus in React Native iOS
/**
* Copyright (c) 2015-present, Facebook, Inc.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
#import "AppDelegate.h"
#import <React/RCTBundleURLProvider.h>
@Transfusion
Transfusion / MainActivity.java
Created January 7, 2019 02:29
Disable screenshot and blank screen upon Activity defocus in React Native Android
import com.facebook.react.ReactActivity;
import android.os.Bundle;
import android.view.WindowManager;
import android.view.WindowManager.LayoutParams;
public class MainActivity extends ReactActivity {
/**
@Transfusion
Transfusion / gist:9a6c1692c47f27dd9b1d6dee0eddc981
Created December 9, 2018 15:08
GitPoint Android build issues
transfusion@transfusion-H370-WIFI:~/git-point$ PATH=$PATH:/home/transfusion/Android/Sdk/platform-tools/ ANDROID_HOME=/home/transfusion/Android/Sdk/ react-native run-android
Scanning folders for symlinks in /home/transfusion/git-point/node_modules (16ms)
Starting JS server...
Building and installing the app on the device (cd android && ./gradlew installDebug)...
Reading env from: .env
File /home/transfusion/.android/repositories.cfg could not be loaded.
Checking the license for package Android SDK Build-Tools 26.0.1 in /home/transfusion/Android/Sdk/licenses
License for package Android SDK Build-Tools 26.0.1 accepted.
Preparing "Install Android SDK Build-Tools 26.0.1".
"Install Android SDK Build-Tools 26.0.1" ready.
@Transfusion
Transfusion / tree_structure_ocr_ext.txt
Created October 4, 2018 00:58
Tree structure of the extension directory
/Users/transfusion/workspace/SampleRhoApp/extensions
├── OCRPoCExt
│ ├── ext
│ │ ├── OCRPoCExt.xml
│ │ ├── build
│ │ ├── build.bat
│ │ ├── platform
│ │ │ ├── android
│ │ │ │ ├── Rakefile
│ │ │ │ ├── ext_java.files
@Transfusion
Transfusion / tree_structure.txt
Created October 1, 2018 09:30
File structure of Rhomobile integration with Tesseract
.
├── app
│ ├── GreetingTest
│ ├── OCRPoCExtTest
│ ├── Settings
│ └── helpers
├── bin
│ └── tmp
├── extensions
│ ├── OCRPoCExt
@Transfusion
Transfusion / build.sh
Created September 29, 2018 00:03
Shell script to build TesseractOCR.framework from source
git clone https://github.com/gali8/Tesseract-OCR-iOS.git
rm -Rf Tesseract-OCR-iOS/build
xcodebuild archive -project Tesseract-OCR-iOS/Tesseract\ OCR\ iOS.xcodeproj -scheme TesseractOCR -sdk iphoneos SYMROOT=build
xcodebuild build -project Tesseract-OCR-iOS/Tesseract\ OCR\ iOS.xcodeproj -target TesseractOCR -sdk iphonesimulator SYMROOT=build
cp -RL Tesseract-OCR-iOS/build/Release-iphoneos Tesseract-OCR-iOS/build/Release-universal/
cp -RL Tesseract-OCR-iOS/build/Release-iphonesimulator Tesseract-OCR-iOS/build/Release-universal/
lipo -create Tesseract-OCR-iOS/build/Release-iphoneos/TesseractOCR.framework/TesseractOCR Tesseract-OCR-iOS/build/Release-iphonesimulator/TesseractOCR.framework/TesseractOCR -output Tesseract-OCR-iOS/build/Release-universal/TesseractOCR.framework/TesseractOCR
cp -r Tesseract-OCR-iOS/build/Release-universal/TesseractOCR.framework .
@Transfusion
Transfusion / infoviz.user.js
Created August 3, 2018 08:27
InfoViz Display Nav Injected JS
// ==UserScript==
// @name Petronas InfoViz navigation script
// @namespace http://tampermonkey.net/
// @version 0.1
// @description Demonstration of adding unique URL to a dynamic javascript page
// @author bryan.wyern1@gmail.com
// @match http://10.14.160.41/viz*
// @grant none
// ==/UserScript==
@Transfusion
Transfusion / 教程.md
Last active March 8, 2021 15:09
drrr.com 定期报时

先打开浏览器 Console。浏览器哪JS方案自动报时需要以下四点:

  1. 怎么获取现在时间, 转化成自己想要的格式

    很容易,创建 var d = Date() 对象, 然后使用 getMonth(), getFullYear() 等方法获取月,年,小时,等

    (参考 https://www.w3schools.com/js/js_date_methods.asp )

@Transfusion
Transfusion / # python - 2017-05-19_09-53-18.txt
Created May 19, 2017 02:00
python on macOS 10.12 - Homebrew build logs
Homebrew build logs for python on macOS 10.12
Build date: 2017-05-19 09:53:18