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 misc; | |
| import java.util.Comparator; | |
| import java.util.Map; | |
| import java.util.TreeMap; | |
| public class ArrayTools | |
| { | |
| private static class ValueComparator<K , V extends Comparable<V>> implements Comparator<K> | |
| { |
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
| public class MessageDecoder extends LineBasedFrameDecoder { | |
| private static final byte D = (byte)':'; | |
| public MessageDecoder(int maxLength) { | |
| super(maxLength); | |
| } | |
| protected Object decode(ChannelHandlerContext ctx, ByteBuf buffer) throws Exception { | |
| ByteBuf m = (ByteBuf) super.decode(ctx, buffer); // run newline decoder |
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 java.nio.charset.StandardCharsets; | |
| public final class Bytes { | |
| protected final byte[] buffer; | |
| public Bytes(byte[] buffer) { | |
| this.buffer = buffer; | |
| } |
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 java.io.*; | |
| import java.nio.MappedByteBuffer; | |
| import java.nio.channels.FileChannel; | |
| import java.util.Arrays; | |
| /** | |
| * Created by Scott Cagno. | |
| * Copyright Cagno Solutions. All rights reserved. | |
| */ |
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 java.beans.BeanInfo; | |
| import java.beans.IntrospectionException; | |
| import java.beans.Introspector; | |
| import java.beans.PropertyDescriptor; | |
| import java.lang.reflect.InvocationTargetException; | |
| import java.lang.reflect.Method; | |
| import java.util.Objects; | |
| import java.util.SortedMap; | |
| import java.util.TreeMap; |
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 main | |
| import ( | |
| "log" | |
| "os" | |
| "path" | |
| ) | |
| func main() { |
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
| #!/usr/bin/env bash | |
| # CHANGE THIS TO THE VERSION YOU WANT TO INSTALL | |
| VERSION="1.7.4" | |
| UPDATED="false" | |
| # CHECKING TO SEE IF WE ARE UPDATING OR INSTALLING NEW | |
| CURRENT=`echo \`go version\` | grep -o '1\..'` | |
| if (( ${VERSION##*.} > ${CURRENT##*.} )); then | |
| UPDATED="true" |
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
| func HandleCORS(fn http.HandlerFunc) http.HandlerFunc { | |
| return func(w http.ResponseWriter, r *http.Request) { | |
| w.Header().Set("Access-Control-Allow-Origin", "*") | |
| fn(w, 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 main | |
| import ( | |
| "bufio" | |
| "encoding/csv" | |
| "encoding/json" | |
| "fmt" | |
| "io" | |
| "os" | |
| "path/filepath" |
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
| #!/bin/bash | |
| # EXAMPLE OPTIONS | |
| #ffmpeg -i $file -ar 44.1k -ab 320k "${file%.mp3}.wav" && rm "$file" | |
| #sox $file -b 24 -r 44100 -c 2 "${file%.mp3}.wav" norm && rm "$file" | |
| function rmspaces { | |
| local dir=$1 | |
| for file in "$dir"/*; do | |
| [ -f "$file" ] && ( mv "$file" "$(echo $file | sed -e 's/ /_/g')" ) |