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
# Authorization confirmed... output the desired file | |
try: | |
ctype = content_type(path) | |
if mboxfile: | |
f = open(os.path.join(mlist.archive_dir() + '.mbox', | |
mlist.internal_name() + '.mbox')) | |
ctype = 'text/plain' | |
elif true_filename[-3:] == '.gz': | |
import gzip | |
f = gzip.open(true_filename, 'r') |
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.mydomain.myapp.resources; | |
import java.io.IOException; | |
import java.io.InputStream; | |
import java.io.OutputStream; | |
import java.lang.annotation.Annotation; | |
import java.lang.reflect.Type; | |
import java.util.List; | |
import java.util.Set; |
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.mydomain.myapp.resources; | |
import java.lang.reflect.ParameterizedType; | |
import java.lang.reflect.Type; | |
import javax.ws.rs.core.Context; | |
import com.sun.jersey.core.spi.component.ComponentContext; | |
import com.sun.jersey.core.spi.component.ComponentScope; | |
import com.sun.jersey.server.impl.inject.AbstractHttpContextInjectable; |
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.mydomain.myapp.resources; | |
import java.lang.reflect.ParameterizedType; | |
import java.lang.reflect.Type; | |
import javax.ws.rs.core.Context; | |
import com.google.common.reflect.TypeToken; | |
import com.sun.jersey.core.spi.component.ComponentContext; |
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.mydomain.myapp.resources.xml; | |
import java.io.IOException; | |
import java.io.InputStream; | |
import java.lang.annotation.Annotation; | |
import java.lang.reflect.Type; | |
import javax.ws.rs.core.MediaType; | |
import javax.ws.rs.core.MultivaluedMap; | |
import javax.ws.rs.ext.MessageBodyReader; |
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.mycompany.ssl; | |
import java.net.Socket; | |
import java.security.Principal; | |
import java.security.PrivateKey; | |
import java.security.cert.X509Certificate; | |
import java.util.List; | |
import javax.annotation.Nullable; | |
import javax.net.ssl.X509KeyManager; |
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
PATH=$PATH:/usr/bin/:/usr/local/bin/:$HOME/bin | |
curl -s "https://api.twitter.com/1.1/users/show.json?screen_name=Cheesies_Truck" \ | |
-H "Authorization: Bearer <token>" \ | |
| jq ".followers_count" \ | |
| xargs -I {} growlnotify -t "Cheesies Count 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
// Copyright 2014 BrightTag, Inc. All rights reserved. | |
package com.brighttag.storm.utils; | |
import backtype.storm.tuple.Values; | |
import storm.trident.operation.BaseFunction; | |
import storm.trident.operation.TridentCollector; | |
import storm.trident.tuple.TridentTuple; | |
/** | |
* Converts the first tuple from a byte array into a string. |
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
List<StateFactory> factories = Lists.newArrayListWithCapacity(mongoHosts.size()); | |
for (String host : mongoHosts) { | |
factories.add(MongoStateFactory.opaque(host, mongoDatabase)); | |
} | |
StateFactory stateFactory = new RandomShardState.Factory(factories); |
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
// Copyright 2014 BrightTag, Inc. All rights reserved. | |
package com.brighttag.storm.utils; | |
import static com.google.common.base.Preconditions.checkArgument; | |
/** | |
* Computes the parallelism for a particular topology and machine configuration. | |
* | |
* @author codyaray | |
* @since 4/21/2014 |
OlderNewer