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
char z = Character.class.getDeclaredMethods()[0].toString().charAt(6) | |
char x = javax.sql.RowSet.class.getName().charAt(5) | |
Object o = ClassLoader.getSystemClassLoader() | |
.loadClass( | |
javax.crypto.Cipher.class.getName().split(String.format("\\%s", x))[0].substring(0, 4) + | |
x + | |
java.lang.annotation.Annotation.class.getName().split(String.format("\\%s", x))[1] + | |
x + | |
Character.toUpperCase(java.sql.Connection.class.getName().split(String.format("\\%s", x))[1].charAt(0)) + |
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
// Adds extra tasks to improve android usage | |
project.android.applicationVariants.all { | |
it.buildType*.name.each { buildType -> | |
def adb = new File(project.android.sdkDirectory as File, '/platform-tools/adb') | |
def buildTypeString = buildType.capitalize() | |
task "run$buildTypeString"(type: Exec, dependsOn: "install$buildTypeString", group: 'run') { | |
description = "Builds and runs the $buildTypeString of the application." |
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
/** | |
* Create a string representation of an object. This will include all fields that are not | |
* transient or static. The returned string will be in the form of `full_class_name{fieldName='value'}` | |
* This will also include all super types values as well in the string. | |
* | |
* @param object The object to get a string representation from. | |
* @return String representation of the object. | |
*/ | |
public static String toString(Object object) { | |
Class<?> aClass = object.getClass(); |
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
def parseArgs = { String input -> | |
def args = [] | |
def m = Pattern.compile("([^\"]\\S*|\".+?\")\\s*").matcher(input); | |
while (m.find()) { | |
args.add(m.group(1)) | |
} | |
return args | |
} | |
run { |
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
// Adds extra tasks to improve android usage | |
project.android.applicationVariants.all { variant -> | |
def adb = new File(project.android.sdkDirectory as File, '/platform-tools/adb') | |
def variantName = variant.name.capitalize() | |
def flavor = variant.flavorName | |
def buildType = variant.buildType.name |
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 | |
WATERMARK="$1" #1st param image to be the water mark | |
#2nd param is path to folder you want all jpg, jpeg or png to | |
#have the water mark added to | |
for image in $2/*{.jpg,.jpeg,.png} | |
do | |
#gravity is the position the water mark will go | |
#50 is the opacity of the image | |
#the second $image is the output file, currently |
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
# .bashrc | |
# Source global definitions | |
if [ -f /etc/bashrc ]; then | |
. /etc/bashrc | |
fi | |
# User specific aliases and functions | |
#Exports |
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
// Place to store all the strings for the CSV | |
var stringBuilder = []; | |
// Get the table, this one happens to be adminlist | |
// Could probably make the more generic | |
var table = document.getElementsByClassName('adminlist')[0]; | |
var tbody = table.getElementsByTagName('tbody')[0] | |
var rows = tbody.getElementsByTagName('tr'); | |
// Loop through each row |
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 GenericsExampleProblem { | |
public static void main(String[] args) { | |
Class myClass = MyClass.class; | |
Method[] myClassMethods = myClass.getDeclaredMethods(); | |
for (Method method : myClassMethods) { | |
// Skip any other methods | |
// This must be done this way instead of with getMethod(String Name, Class<?>... params) since | |
// we can not possibly know the params until at run time | |
if (!method.getName().equals("myMethod")) { |
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.smartthings.android.common.http; | |
import com.inkapplications.preferences.IntPreference; | |
import com.smartthings.android.di.annotation.HttpDisasterRate; | |
import com.squareup.okhttp.Interceptor; | |
import com.squareup.okhttp.Protocol; | |
import com.squareup.okhttp.MediaType; | |
import com.squareup.okhttp.Response; | |
import com.squareup.okhttp.Request; | |
import com.squareup.okhttp.ResponseBody; |