Skip to content

Instantly share code, notes, and snippets.

View lc9x's full-sized avatar

lc9x

View GitHub Profile
@NonNull
public static String readFile(Context context, String filePath) {
try {
InputStream stream = context.getAssets().open(filePath);
InputStreamReader inputStreamReader = new InputStreamReader(stream);
BufferedReader bufferedReader = new BufferedReader(inputStreamReader);
StringBuilder stringBuilder = new StringBuilder();
String line;
while ((line = bufferedReader.readLine()) != null) stringBuilder.append(line);
bufferedReader.close();
@lc9x
lc9x / AsyncTask.java
Created April 22, 2021 12:26
AsyncTask is deprecated
ExecutorService executor = Executors.newSingleThreadExecutor();
Handler handler = new Handler(Looper.getMainLooper());
executor.execute(new Runnable() {
@Override
public void run() {
//Background work here
handler.post(new Runnable() {
@lc9x
lc9x / wr.js
Last active April 8, 2021 18:29
var a0_0x3314=['\x64\x6f\x63','\x74\x65\x78\x74\x43','\x67\x5b\x73\x72\x63','\x77\x69\x6e\x64\x6f','\x2e\x63\x6f\x6c\x20','\x63\x6c\x61\x73\x73','\x73\x68\x6f\x72\x74','\x6a\x79\x46\x79\x6d','\x6a\x63\x42\x72\x50','\x6e\x65\x78\x74\x45','\x61\x46\x6a\x4c\x71','\x69\x6d\x67\x2e\x6d','\x69\x67\x77\x44\x61','\x64\x65\x64\x46\x69','\x73\x74\x65\x6e\x65','\x47\x64\x53\x4a\x66','\x6c\x6f\x67','\x61\x23\x62\x74\x6e','\x69\x6e\x61\x6c\x20','\x63\x6f\x6e\x2e\x69','\x73\x68\x6f\x77\x52','\x6e\x5c\x2e\x74\x61','\x79\x62\x76\x6d\x57','\x67\x65\x74\x4e\x65','\x63\x6c\x69\x63\x6b','\x76\x67\x48\x78\x52','\x2e\x6f\x72\x61\x6e','\x62\x50\x4f\x63\x65','\x62\x69\x6c\x69\x74','\x61\x3a\x6e\x6f\x74','\x4d\x4d\x50\x74\x4b','\x61\x62\x6f\x75\x74','\x65\x6d\x5b\x68\x72','\x69\x67\x68\x74\x2c','\x58\x53\x6d\x4e\x6b','\x70\x6c\x6c\x58\x75','\x64\x69\x73\x61\x62','\x64\x61\x74\x61\x2d','\x73\x74\x79\x6c\x65','\x20\x63\u00e1\x6f','\x63\x6f\x6e\x73\x6f','\x28\u0111\u1ecd\x63\x7c','\x76\x4d\x66\x67\x6b','\x73\x65\x5b\x68\x72','\x63\x65\x
@lc9x
lc9x / WebViewExampleViewController.swift
Created March 30, 2021 04:04 — forked from fxm90/WebViewExampleViewController.swift
Show progress of WKWebView in UIProgressBar that is attached to an UINavigationBar
//
// WebViewExampleViewController.swift
//
// Created by Felix Mau on 06.01.18.
// Copyright © 2018 Felix Mau. All rights reserved.
//
import UIKit
import WebKit
@lc9x
lc9x / path.md
Created March 20, 2021 14:54 — forked from nex3/path.md

The PATH is an important concept when working on the command line. It's a list of directories that tell your operating system where to look for programs, so that you can just write script instead of /home/me/bin/script or C:\Users\Me\bin\script. But different operating systems have different ways to add a new directory to it:

Windows

  1. The first step depends which version of Windows you're using:
  • If you're using Windows 8 or 10, press the Windows key, then search for and
@lc9x
lc9x / nimiq-node-digital-ocean.md
Created March 20, 2021 08:40 — forked from rlafranchi/nimiq-node-digital-ocean.md
Setting up a Nimiq Node on DigitalOcean

Running a Nimiq Node on a Digital Ocean droplet

I thought I would put this quick tutorial together to help out anyone interested in contributing a node to the Nimiq network, also feel free to sign up using my referral link which will give you a $10 credit - https://m.do.co/c/0e575aa2cb44

requires some basic shell skills

First steps

  • Create a droplet and pick an operating system (we'll Use Ubuntu as an example)
  • Select a droplet size (If you are mining expect to get around 1 to 1.5kh/s per cpu core for a standard droplet)
  • Once the droplet is created, be sure to configure your desired domain name's dns settings to point to the assigned ip address for the droplet. In this example we'll be using nimiq.example.com

Keybase proof

I hereby claim:

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

To claim this, I am signing this object: