Skip to content

Instantly share code, notes, and snippets.

View apsun's full-sized avatar

Andrew Sun apsun

View GitHub Profile
import java.lang.reflect.Field;
import java.lang.reflect.Method;
import java.util.ArrayList;
public final class ReflectionHelper {
private ReflectionHelper() { }
public static String dumpFields(Object self, boolean dumpValues) {
return dumpFields(self.getClass(), self, dumpValues);
}
import random
from timeit import Timer
def insertion_sort(array):
for i in range(1, len(array)):
j = i
item = array[j]
while j > 0 and compare(item, array[j - 1]):
j -= 1
import zipfile
import shutil
import os
import errno
import tempfile
# Path containing game files (main.lua should be in this directory)
SRC_PATH = "D:\Files\Documents\IdeaProjects\OpenFire\src"
# Name of the executable file in the output directory/zip file
#!/usr/bin/env python
#
# HearthPhone: Allows the installation of Hearthstone on Android phones.
# Copyright (c) 2015 @crossbowffs
#
# This program is not affiliated with Blizzard Entertainment, Inc.
# No promises are made about the effects of this program. It may do
# anything from discarding your entire hand to summoning 7 Ragnaroses
# for your opponent. Use it at your own risk.
#
# Requires: ntplib (https://pypi.python.org/pypi/ntplib/)
import ctypes
import time
import ntplib
MAX_RETRIES = 10
RETRY_DELAY = 30
NTP_SERVERS = [
"0.tw.pool.ntp.org",
function insertionSort(array)
for i = 2, #array do
local j = i
local item = array[i]
while j > 1 and compare(item, array[j - 1]) do
array[j] = array[j - 1]
j = j - 1
end
array[j] = item
end
// ==UserScript==
// @name SHSID WiFi AutoLogin
// @namespace crossbowffs
// @description Automatically enters your username and password on the SHSID WiFi login page.
// @include http://192.255.255.94/
// @version 1.0
// ==/UserScript==
//-------Change these values-------
var username = "YOUR_USERNAME_HERE"; // e.g: G2042010546
// Requires Magick.NET (https://magick.codeplex.com/)
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
using ImageMagick;
namespace GifShrinker
{
using System;
using System.Diagnostics;
using System.Drawing;
using System.Drawing.Drawing2D;
using System.Drawing.Imaging;
using System.IO;
using System.Windows.Forms;
namespace WallpaperFixer
{
#define BLOCK_SIZE 3 // Higher means longer time to find a seed, but smaller output
#define SPLIT_NON_ALPHA 0 // Highly recommend setting to 1 if BLOCK_SIZE > 3
#define DELIMITER '|' // Used to store encrypted data for later use
#define LINE_DELIMITER '\n' // Separates blocks, cannot be the same as DELIMITER
#define ENCRYPT_ENABLED 1
#define DECRYPT_ENABLED 0
#define META_ENCRYPT 1 // So you can copy-paste the output from the console below
#define ENCRYPT_ME ""
#define DECRYPT_ME ""