This file contains hidden or 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
/** | |
* Current standard is RFC 3986, published in 2005: http://tools.ietf.org/html/rfc3986#page-50. Apache Commons has a | |
* url validator, but it doesn't accept certain urls, probably because it's implementing RFC2396 from 1998. Also, the | |
* Fitbit API validator has custom needs such as allowing unicode characters. | |
* <p/> | |
* REGEX_COMPILED is used by UrlTypeConverter and MultiUrlsTypeConverter to validate third party app urls. | |
* <p/> | |
* All regex parts are borrowed from dperini's "https://gist.github.com/dperini/729294" unless otherwise noted. | |
* The dperini regex satisfies most of the test cases here: https://mathiasbynens.be/demo/url-regex, and has undergone |
This file contains hidden or 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
/* | |
This script, when used with Google Apps Scripts, will delete 400 emails and | |
can be triggered to run every few minutes without user interaction enabling you | |
to bulk delete email in Gmail without getting the #793 error from Gmail. | |
Google returns a maximum of 500 email threads in a single API call. | |
This script fetches 400 threads in case 500 threads is causing timeouts | |
Configure the search query in the code below to match the type of emails | |
you want to delete |
This file contains hidden or 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.ilirium.client; | |
import java.io.ByteArrayOutputStream; | |
import java.io.FileNotFoundException; | |
import java.io.FileOutputStream; | |
import java.io.IOException; | |
import java.io.PrintStream; | |
import java.math.BigInteger; | |
import java.security.InvalidKeyException; | |
import java.security.KeyPair; |
This file contains hidden or 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 com.google.common.reflect.TypeToken; | |
@SuppressWarnings("unchecked") | |
public T get() | |
{ | |
final Class<T> entityType = (Class<T>) new TypeToken<T>(getClass()) {}.getRawType(); | |
try { return entityType.newInstance(); } | |
catch (InstantiationException | IllegalAccessException e) { throw new RuntimeException(e); } | |
} |
This file contains hidden or 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
/* | |
* Bulk download of Coursera videos with wget. | |
* | |
* Copyright (c) 2014 Anton Ivanov [email protected] | |
* | |
* Permission is hereby granted, free of charge, to any person obtaining a copy | |
* of this software and associated documentation files (the "Software"), to deal | |
* in the Software without restriction, including without limitation the rights | |
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | |
* copies of the Software, and to permit persons to whom the Software is |
This file contains hidden or 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
# Windows (cmd) Command line version | |
forfiles /S /M *.jar /C "cmd /c jar -tvf @file | findstr /C:"$1" && echo @path" |
This file contains hidden or 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 self.vpalepu.stackoverflow; | |
import java.io.File; | |
import java.io.FileInputStream; | |
import java.io.IOException; | |
import org.objectweb.asm.ClassReader; | |
import org.objectweb.asm.ClassVisitor; | |
import org.objectweb.asm.ClassWriter; | |
import org.objectweb.asm.MethodVisitor; |
This file contains hidden or 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
/* | |
* http://www.myersdaily.org/joseph/javascript/md5-text.html | |
*/ | |
(function() { | |
var md5cycle = function(x, k) { | |
var a = x[0], b = x[1], c = x[2], d = x[3]; | |
a = ff(a, b, c, d, k[0], 7, -680876936); |
This file contains hidden or 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
var underscore = (function(underscore){ | |
// Build several namespaces, globally... | |
var UUID = {}; | |
var Sha1 = function(str){return Sha1.hash(str, true);}; | |
var Utf8 = {}; | |
var extend = function() { | |
var options, name, src, copy, copyIsArray, clone, |
This file contains hidden or 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
1. | |
ssh-keygen -t rsa -f ~/.ssh/id_rsa.work -C "Key for Word stuff" | |
2. | |
touch ~/.ssh/config | |
chmod 600 ~/.ssh/config | |
echo "IdentityFile ~/.ssh/id_rsa.work" >> ~/.ssh/config | |
echo "IdentityFile ~/.ssh/id_rsa.misc" >> ~/.ssh/config | |