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 main | |
import ( | |
"encoding/json" | |
"fmt" | |
"io/ioutil" | |
) | |
type Policy struct { | |
Name string |
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
@Override | |
public void run(ApiServiceConfiguration config, Environment env) throws Exception { | |
... | |
// works | |
env.getObjectMapperFactory().setDateFormat(new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSSZ")); | |
// works | |
env.getObjectMapperFactory().setDateFormat(new ISO8601DateFormat.getInstance()); | |
// doesn't work | |
env.getObjectMapperFactory().setDateFormat(ISO8601DateFormat.getInstance()); | |
... |
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
[{"total":16,"sent_hour":"08"},{"total":16,"sent_hour":"09"},{"total":24,"sent_hour":"10"},{"total":14,"sent_hour":"11"},{"total":6,"sent_hour":"12"},{"total":22,"sent_hour":"13"},{"total":32,"sent_hour":"14"},{"total":14,"sent_hour":"15"},{"total":10,"sent_hour":"16"},{"total":10,"sent_hour":"17"},{"total":4,"sent_hour":"18"},{"total":8,"sent_hour":"20"},{"total":6,"sent_hour":"21"},{"total":20,"sent_hour":"22"},{"total":2,"sent_hour":"23"}] |
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
# Add this to your .bashrc or .bash_profile to set up "bookmarks" for your directories. | |
# When in a directory, type "s <name>" to store the current path as a bookmark with that name. | |
# To move to a bookmark, type "g <name>". Tab completion also works! | |
# To list all bookmarks, type "l". | |
# | |
# Credit to: Karthick from http://www.huyng.com/archives/quick-bash-tip-directory-bookmarks/492/ | |
function s { | |
cat ~/.sdirs | grep -v "export DIR_$1=" > ~/.sdirs1 | |
mv ~/.sdirs1 ~/.sdirs |
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
num_longest = ARGV[1].to_i | |
longest_lines = [] | |
shortest_len = -1 | |
infile = File.new(ARGV[0], "r") | |
while ( line = infile.gets ) | |
unless line.length > shortest_len | |
continue | |
end | |