This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
include $(GOROOT)/src/Make.inc | |
GOFMT=gofmt -spaces=true -tabindent=false -tabwidth=4 | |
all: | |
$(GC) jsontest.go | |
$(LD) -o jsontest.out jsontest.$O | |
format: | |
$(GOFMT) -w jsontest.go |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"bufio" | |
"bytes" | |
"flag" | |
"fmt" | |
"github.com/golang/groupcache" | |
"io" | |
"net" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"bytes" | |
"fmt" | |
"github.com/golang/groupcache" | |
"image" | |
_ "image/gif" | |
_ "image/jpeg" | |
"image/png" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"log" | |
"github.com/piotrnar/gocoin/blockdb" | |
"github.com/piotrnar/gocoin/btc" | |
"encoding/hex" | |
) | |
func main() { | |
// Set real Bitcoin network |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
CBlock block; | |
block.nNonce = 2084731820; | |
block.vtx.push_back(txNew); | |
block.hashPrevBlock = 0; | |
block.hashMerkleRoot = block.BuildMerkleTree(); | |
block.nVersion = 1; | |
block.nTime = 1409745976; | |
block.nBits = 0x1e0ffff0; | |
#if 1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Use the Ubuntu Linux distro as the base for this image | |
FROM ubuntu | |
# Install necessary build tools | |
RUN apt-get update && apt-get upgrade --yes && apt-get install build-essential clang git --yes | |
# Download and install PseudoNode | |
RUN cd /root && git clone https://github.com/basil00/PseudoNode.git && cd ./PseudoNode && make | |
# These two commands enable port 8333 to be routed and start the node by default | |
EXPOSE 8333 | |
CMD ["bash", "-c", "cd /root/PseudoNode && ./pseudonode --stealth --coin=bitcoin-xt"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
usage() | |
{ | |
cat << EOF | |
usage: $0 options | |
This script sets ownership for all tables, sequences, views, and functions for a given schema. | |
Run this script as your postgres OS user. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Utility class for access to runtime permissions. | |
*/ | |
public abstract class PermissionUtils { | |
/** | |
* Requests the fine location permission. If a rationale with an additional explanation should | |
* be shown to the user, displays a dialog that triggers the request. | |
*/ | |
public static void requestPermission(AppCompatActivity activity, int requestId, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class RxBus { | |
private static RxBus instance = null; | |
private final Subject<Object, Object> _bus = new SerializedSubject<>(PublishSubject.create()); | |
private static RxBus getInstance() { | |
if (instance == null) { | |
instance = new RxBus(); | |
} | |
return instance; | |
} |
OlderNewer