Skip to content

Instantly share code, notes, and snippets.

View david-guzman's full-sized avatar

David Guzman david-guzman

View GitHub Profile
@david-guzman
david-guzman / nginx.conf
Created August 21, 2020 10:38 — forked from Stanback/nginx.conf
Example Nginx configuration for adding cross-origin resource sharing (CORS) support to reverse proxied APIs
#
# CORS header support
#
# One way to use this is by placing it into a file called "cors_support"
# under your Nginx configuration directory and placing the following
# statement inside your **location** block(s):
#
# include cors_support;
#
# As of Nginx 1.7.5, add_header supports an "always" parameter which
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE module PUBLIC "-//Checkstyle//DTD Checkstyle Configuration 1.3//EN" "https://checkstyle.org/dtds/configuration_1_3.dtd">
<!--
Checkstyle configuration that checks the sun coding conventions from:
- the Java Language Specification at
https://docs.oracle.com/javase/specs/jls/se11/html/index.html
- the Sun Code Conventions at https://www.oracle.com/technetwork/java/codeconvtoc-136057.html
@david-guzman
david-guzman / multi_key_crypto.sh
Created July 20, 2018 12:15 — forked from kennwhite/multi_key_crypto.sh
OpenSSL command line recipe for multi-public key file encryption. Any single private key paired to one of the public keys can decrypt the file.
#!/usr/bin/env bash
#
# Example of multiple key AES encryption for text files using the openssl v. 0.9.8+ command line utility
# Uses n public certs as key for MIME PKCS envelope, any individual private key can decrypt.
#
# If standard RSA ssh keys exist, these can be converted to public certs as well (and ssh keys can decrypt)
#
# To sign (and verify) the encrypted file, one of the private keys is required, see:
# http://www.openssl.org/docs/apps/smime.html#EXAMPLES for openssl smime examples
# or http://www.openssl.org/docs/apps/cms.html#EXAMPLES for cms utility (OpenSSL v. 1.0+)
@david-guzman
david-guzman / tweets.json
Created January 12, 2018 19:44
Example response from Twitter Standard search API obtained by wsclient-app
{
"statuses":[
{
"created_at":"Wed Jan 03 23:29:25 +0000 2018",
"id":948697840452341760,
"id_str":"948697840452341760",
"text":"RT @Bobilly10: Once again, the current NHS crisis being blamed on winter flu and ageing population! No one denies these are factors but sto\u2026",
"truncated":false,
"metadata":{
"iso_language_code":"en",
@david-guzman
david-guzman / geocrawler.json
Created December 20, 2017 15:43
Example response obtained by TwitterGeoCrawler
[
{
"retweeted":false,
"in_reply_to_screen_name":null,
"possibly_sensitive":false,
"truncated":true,
"lang":"en",
"in_reply_to_status_id_str":null,
"id":942182749036797954,
"in_reply_to_user_id_str":null,
@david-guzman
david-guzman / fluwords.json
Created December 19, 2017 17:45
Example response from Twitter Streaming API Resource URL https://stream.twitter.com/1.1/statuses/filter.json
{
"quote_count":0,
"contributors":null,
"truncated":false,
"text":"Wind 6.7 m/s WNW. Barometer 1018.6 hPa, Rising. Temperature -2.3 &amp;deg;C. Rain today 0.0 mm. Humidity 76%",
"is_quote_status":false,
"in_reply_to_status_id":null,
"reply_count":0,
"id":943164049121878021,
"favorite_count":0,
@david-guzman
david-guzman / sample.json
Created December 19, 2017 17:42
Example response from Twitter Streaming API Resource URL https://stream.twitter.com/1.1/statuses/sample.json
{
"quote_count":0,
"contributors":null,
"truncated":false,
"text":"\u30d6\u30ed\u30b0\u8a18\u4e8b\u7d39\u4ecb\uff1a\u304a\u7d75\u304b\u304dPhone\u30a2\u30d7\u30ea\u3092\u4f5c\u3063\u3066\u307f\u305f #1\u300c\uff13\uff10\u5206\u3067\u7c21\u5358\u6a5f\u80fd\u306e\u69cb\u7bc9\u300d https://t.co/WL6HtrDJkP\n#xcode #iPhone #\u304a\u7d75\u304b\u304diPhone\u30a2\u30d7\u30ea #development https://t.co/bhYU6RycP6",
"is_quote_status":false,
"in_reply_to_status_id":null,
"reply_count":0,
"id":943164047268048896,
"favorite_count":0,
@david-guzman
david-guzman / geofilter.json
Last active December 19, 2017 17:36
Example response from Twitter Streaming API Resource URL https://stream.twitter.com/1.1/statuses/filter.json
{
"contributors": null,
"coordinates": null,
"created_at": "Tue Dec 19 14:00:06 +0000 2017",
"display_text_range": [
21,
77
],
"entities": {
"hashtags": [
@david-guzman
david-guzman / pom.xml
Created August 23, 2017 16:58
Combine inmemdb and glassfish embedded plugins
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>guzman.weblog.servlet</groupId>
<artifactId>servlet-jsr375</artifactId>
<version>1.0.0-SNAPSHOT</version>