Skip to content

Instantly share code, notes, and snippets.

package main
import (
"time"
)
type ReadState uint64
func (rs *ReadState) UnreadCounts() uint8 {
return uint8(*rs >> 56)
}

Keybase proof

I hereby claim:

  • I am thesyncim on github.
  • I am thesyncim (https://keybase.io/thesyncim) on keybase.
  • I have a public key ASCaBwn5eIrrsEYCEhchrOftanVgXEkd0_gMSqlD8n4p4Qo

To claim this, I am signing this object:

@thesyncim
thesyncim / flatten.go
Last active August 31, 2018 11:07
flatten slice
package flatten
import (
"reflect"
)
//flatten method creates a new slice with all sub-slice elements concatted into it recursively
func Flatten(slice interface{}) []interface{} {
//validate input
//must be a slice
@thesyncim
thesyncim / wordcounter.go
Last active August 31, 2018 11:06
count the word frequency
//todo balanced tree (should make any difference because keys are kinda random)
//todo avoid allocation bytes.ToLower
//todo reduce allocations
package main
import (
"bufio"
"bytes"
"errors"
package main
import (
"encoding/xml"
"os"
)
package backup
import (
"io"
"log"
"os"
"path/filepath"
"time"
package main
import (
"github.com/dgrijalva/jwt-go"
"log"
"net/http"
"time"
)
var (