Skip to content

Instantly share code, notes, and snippets.

View DV8FromTheWorld's full-sized avatar
💭
Through code, all things are possible.

Austin Keener DV8FromTheWorld

💭
Through code, all things are possible.
View GitHub Profile
private static void writeToConnection(HttpURLConnection conn, String message)
{
OutputStreamWriter writer;
try
{
writer = new OutputStreamWriter(conn.getOutputStream());
writer.write(message);
writer.flush();
writer.close();
}
@DV8FromTheWorld
DV8FromTheWorld / gist:8e60f49272bd724dce09
Created July 3, 2014 19:01
initVisualComponents : Imgur Uploader Java :
/**
* Initializes all visual components of the GUI and adds them to the GUI.
* Also sets the GUI's settings.
*/
private void initVisualComponents()
{
this.setTitle("Imgur Uploader");
this.setSize(SIZE_GUI_X, SIZE_GUI_Y);
this.setDefaultCloseOperation(JFrame.DO_NOTHING_ON_CLOSE);
this.setResizable(false);
/**
* Uses Regex on the provided JSON String to find the 'link' tag.
*
* @param jsonResponse
* The JSON response from Imgur.
* @return
* The link to the image.
*/
private String getLink(String jsonResponse)
{
Desktop desktop = Desktop.isDesktopSupported() ? Desktop.getDesktop() : null;
if (desktop != null && desktop.isSupported(Desktop.Action.BROWSE))
{
try
{
new URI(url);
btnOpenBrowser.setEnabled(true);
btnCopyLink.setEnabled(true);
}
catch (URISyntaxException e)
/**
* Captures the currently selected area of the screen and sends it to the
* System Clipboard as an image.
*
* Sets the capture button non-visible so it is not captured in the screenshot.
*/
private void captureArea()
{
btnCapture.setVisible(false);
this.repaint();
package net.dv8tion.android.beekeeper.datatype;
public class Frame
{
private String name;
private int id;
private int superId;
public String getName()
package net.dv8tion.android.beekeeper.datahandler;
import java.util.ArrayList;
import java.util.List;
import net.dv8tion.android.beekeeper.MySQLiteHelper;
import net.dv8tion.android.beekeeper.datatype.Comment;
import android.content.ContentValues;
import android.content.Context;
public void onTickInGame(float f, ats mc)
{
try
{
this.renderPartialTicks = f;
this.currentTimeMillis = System.currentTimeMillis();
GL11.glPushAttrib(1048575);
GL11.glPushClientAttrib(-1);
GL11.glPushMatrix();
package net.dv8tion.beekeeper;
import java.io.Serializable;
import java.lang.reflect.ParameterizedType;
import java.util.List;
import net.dv8tion.android.beekeeper.R;
import android.app.ListActivity;
import android.content.Intent;
import android.os.Bundle;
using System;
using UnityEngine;
using System.Collections;
public class Graph : MonoBehaviour
{
private const float LOWER_LIMIT = -1.8f;
private const float ZERO = -0.425f;
private const float UPPER_LIMIT = .95f;
private const float ZERO_TO_LIMIT = 1.375f;