Skip to content

Instantly share code, notes, and snippets.

View typelogic's full-sized avatar
🏹

typelogic typelogic

🏹
View GitHub Profile
getjavaversion() {
java -version 2>&1 | awk 'NR==1{gsub("\"","");print $3}'
}
is_uoc() {
[ -r .data/.m2/settings.xml ] && printf M
}
git_branch() {
[ -d .git ] && git branch --show-current
@typelogic
typelogic / send.js
Last active September 4, 2020 04:26
No dependency http test app
#!/usr/bin/env node
user = "user";
hostname = "localhost";
port = 8080;
payload = "{}";
hubSignature = "";
const http = require('http');
@typelogic
typelogic / qr_snippet.java
Created July 16, 2020 04:04
QR reader snippet to read binary qr encoded
import com.google.zxing.*;
import com.google.zxing.client.j2se.BufferedImageLuminanceSource;
import com.google.zxing.common.HybridBinarizer;
private static byte[] decodeQRCode(File qrCodeimage) throws IOException
{
BufferedImage bufferedImage = ImageIO.read(qrCodeimage);
LuminanceSource source = new BufferedImageLuminanceSource(bufferedImage);
BinaryBitmap bitmap = new BinaryBitmap(new HybridBinarizer(source));
@typelogic
typelogic / convert.md
Created June 2, 2020 06:17
change black to red

Change black to red:

nix-shell -p imagemagick
convert qrdata89.bmp -fuzz 20% -fill blue -opaque black b.bmp
@typelogic
typelogic / stockfish-interface.txt
Created May 9, 2020 05:41 — forked from aliostad/stockfish-interface.txt
stockfish - Description of the universal chess interface (UCI)
COPIED FROM https://build.opensuse.org/package/view_file/games/stockfish/stockfish-interface.txt?expand=1
Description of the universal chess interface (UCI) April 2006
=================================================================
* The specification is independent of the operating system. For Windows,
the engine is a normal exe file, either a console or "real" windows application.
* all communication is done via standard input and output with text commands,
@typelogic
typelogic / qq
Created April 27, 2020 14:05
qr code
0d d5 11 91 00 e5 27 6d
β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ β–ˆβ–ˆ β–ˆβ–ˆ β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ
β–ˆβ–ˆ β–ˆβ–ˆ β–ˆβ–ˆ β–ˆβ–ˆ β–ˆβ–ˆ β–ˆβ–ˆ β–ˆβ–ˆ
β–ˆβ–ˆ β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ β–ˆβ–ˆ β–ˆβ–ˆ β–ˆβ–ˆβ–ˆβ–ˆ β–ˆβ–ˆ β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ β–ˆβ–ˆ
β–ˆβ–ˆ β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ β–ˆβ–ˆ β–ˆβ–ˆ β–ˆβ–ˆ β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ β–ˆβ–ˆ
β–ˆβ–ˆ β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ β–ˆβ–ˆ β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ β–ˆβ–ˆ β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ β–ˆβ–ˆ
β–ˆβ–ˆ β–ˆβ–ˆ β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ β–ˆβ–ˆ β–ˆβ–ˆ
β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ β–ˆβ–ˆ β–ˆβ–ˆ β–ˆβ–ˆ β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ
β–ˆβ–ˆ
@typelogic
typelogic / RealPathUtil.java
Created April 22, 2020 11:02 — forked from tatocaster/RealPathUtil.java
Real Path Utility class for Android, works for all API
public class RealPathUtil {
public static String getRealPath(Context context, Uri fileUri) {
String realPath;
// SDK < API11
if (Build.VERSION.SDK_INT < 11) {
realPath = RealPathUtil.getRealPathFromURI_BelowAPI11(context, fileUri);
}
// SDK >= 11 && SDK < 19
else if (Build.VERSION.SDK_INT < 19) {
*** Oppo_F9_CPH1823 ***
1584315299.067 org.idpass.recogtest I/org.idpass: before constructor
1584315299.092 org.idpass.recogtest I/org.idpass.lib: Recog JNI constructor
1584315299.092 org.idpass.recogtest I/org.idpass: after constructor
1584315299.093 org.idpass.recogtest I/org.idpass: after API call
1584315299.093 org.idpass.recogtest I/org.idpass.lib::: ** compute start ***
1584315299.093 org.idpass.recogtest I/org.idpass.lib::: *** -LOAD MODELS ***
1584315302.822 org.idpass.recogtest I/org.idpass.lib::: *** +LOAD MODELS ***
1584315302.822 org.idpass.recogtest I/org.idpass.lib::: *** -load_image ***
@typelogic
typelogic / flux.cpp
Created March 13, 2020 09:19
c++ streams
#include <iostream>
#include <istream>
#include <fstream>
#include <string>
using namespace std;
int main()
{
string filename = "text.txt";
ios::openmode mode = /* ifstream::in;*/ ios::binary;
@typelogic
typelogic / networking.md
Last active March 9, 2020 18:23
networking

f11366d9b46d183f724a7f35ac11cbce

With missing /etc/wpa_supplicant.conf, and need to connect to an SSID:

wpa_supplicant -B -i wlp1s0 -c <(wpa_passphrase '<mySSID>' '<myPassword>')