Skip to content

Instantly share code, notes, and snippets.

View stunstunstun's full-sized avatar
🤝
Playing as a Team

정민혁 stunstunstun

🤝
Playing as a Team
View GitHub Profile
#!/bin/bash
<<COMMENT
✨ Simple Installation of the latest Brew, Cask, Git, Node.js, and visual-studio-code for OSX!
@Author: Minhyeok Jung
@License: MIT
[Example Usage]
Download this file, and from the directory, run in terminal
chmod +x configure-osx.sh
package com.holaxapps.chomdoi.support;
import org.junit.Test;
import java.security.KeyPair;
import java.security.NoSuchAlgorithmException;
import static org.assertj.core.api.Assertions.assertThat;
/**
@stunstunstun
stunstunstun / Security.java
Created June 12, 2017 07:38
Security.java
package com.holaxapps.chomdoi.support;
import javax.crypto.*;
import java.io.UnsupportedEncodingException;
import java.security.*;
import java.security.spec.InvalidKeySpecException;
import java.security.spec.PKCS8EncodedKeySpec;
import java.security.spec.X509EncodedKeySpec;
import java.util.Base64;
public static final String getKeyHash(Context context) {
try {
PackageInfo info = context.getPackageManager().getPackageInfo(context.getPackageName(), PackageManager.GET_SIGNATURES);
for (Signature signature : info.signatures) {
MessageDigest md = MessageDigest.getInstance("SHA");
md.update(signature.toByteArray());
String keyHash = Base64.encodeToString(md.digest(), Base64.DEFAULT);
Logger.d(TAG + "KeyHash:%s", keyHash);
return keyHash;
}
public class Fibo {
private static final int MAX_COUNT = 10;
private static List<Integer> numbers = new ArrayList<Integer>();
public static void main(String[] args) {
// Get
for(int i = 0 ; i < MAX_COUNT ; i++) {
numbers.add(fibo(i));
}
public class Marine {
private int level;
private String color;
public static final int type = 1;
public void upgradeWeapon(int weaponType, int itemLevel) {
int newLevel = level > itemLevel ? level : level + weaponType;
System.out.println("New Level is " + newLevel);
}
}
Settings.Secure.ANDROID_ID
<activity
....
....
android:launchMode="singleTask" />
<string name="joyple_facebook_application_id">{Facebook APP ID}</string>
String caption = "caption";
String content = "content";
System.out.println("caption = " + Integer.toHexString(caption.hashCode()));
System.out.println("content = " + Integer.toHexString(content.hashCode()));
System.out.println("contentOthers = " + Integer.toHexString(content.replace(content, "contentOthers").hashCode()));