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/sh | |
# | |
# Downloads and installs the startssl CA certs into the global java keystore | |
# Author: Klaus Reimer <k@ailis.de> | |
# | |
# Check if JAVA_HOME is set | |
if [ "$JAVA_HOME" = "" ] | |
then | |
echo "ERROR: JAVA_HOME must be set." |
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
import org.apache.tools.ant.taskdefs.condition.Os | |
def getPlatformNdkBuildCommand() { | |
def rootDir = project.rootDir | |
def localProperties = new File(rootDir, "local.properties") | |
if (localProperties.exists()) { | |
Properties properties = new Properties() | |
localProperties.withInputStream { | |
instr -> properties.load(instr) | |
} |
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
sudo su | |
echo "deb http://downloads.hipchat.com/linux/apt stable main" > \ /etc/apt/sources.list.d/atlassian-hipchat.list | |
wget -O - https://www.hipchat.com/keys/hipchat-linux.key | apt-key add - | |
apt-get update | |
apt-get install hipchat |
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
import java.util.concurrent.ExecutionException; | |
import java.util.concurrent.ExecutorService; | |
import java.util.concurrent.Executors; | |
import java.util.concurrent.Future; | |
/** | |
* | |
*/ | |
public final class StackBlur { | |
private static final int PARALLEL_THRESHOLD = 2048 * 2048; |
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
pragma solidity ^0.4.10; | |
interface ERC20 { | |
function balanceOf(address who) public view returns (uint256); | |
function transfer(address to, uint256 value) public returns (bool); | |
function allowance(address owner, address spender) public view returns (uint256); | |
function transferFrom(address from, address to, uint256 value) public returns (bool); | |
function approve(address spender, uint256 value) public returns (bool); | |
event Transfer(address indexed from, address indexed to, uint256 value); |
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 | |
# poor-man's quantum photon detector randomizer | |
# ~1kb/s | |
# over a test of a thousand time, global entropy was equal to 7.99/8 and passed nearly all Dieharder tests, as well as FIPS 140-2 | |
# however, sigma, mean and chi-square stats aren't too much enthusiastic | |
# overall, the result is pretty impressive, but of course, don't use it in production :) | |
DEVICE=/dev/video0 | |
# for external cameras should be /dev/video1 |
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
import java.security.*; | |
public class Sha { | |
public static String hash256(String data) throws NoSuchAlgorithmException { | |
MessageDigest md = MessageDigest.getInstance("SHA-256"); | |
md.update(data.getBytes()); | |
return bytesToHex(md.digest()); | |
} | |
public static String bytesToHex(byte[] bytes) { | |
StringBuffer result = new StringBuffer(); | |
for (byte byt : bytes) result.append(Integer.toString((byt & 0xff) + 0x100, 16).substring(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
package com.eclipsesource.j2v8.tutorial; | |
import java.io.File; | |
import java.io.IOException; | |
import java.io.PrintWriter; | |
import java.nio.ByteBuffer; | |
import com.eclipsesource.v8.NodeJS; | |
import com.eclipsesource.v8.Releasable; | |
import com.eclipsesource.v8.V8Array; |
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/sh | |
# Inpiration: http://engineeringblog.yelp.com/2016/05/yelp-android-app-went-on-a-diet.html | |
# `-lossless` not used to give support for Android 4.0+ | |
# Make sure cwebp is installed. | |
if ! type "cwebp" > /dev/null; then | |
echo "Please install cwebp to continue:" | |
echo "brew install webp" | |
exit 1 | |
fi |
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
import java.lang.ClassLoader; | |
import java.lang.String; | |
import java.lang.System; | |
import java.lang.reflect.Field; | |
class UpdateJavaLibPath { | |
public static String printLibPath() { | |
String current = System.getProperty("java.library.path"); | |
System.out.println(String.format("current = %s", current)); |
OlderNewer