Skip to content

Instantly share code, notes, and snippets.

dateToMillis() {
#date as YYYY-MM-DD
echo $((`gdate -d $1 +%s` * 1000))
}
millisToDate() {
gdate -d @`echo $(( $1 / 1000 ))`
}
@guicaro
guicaro / slack_history.py
Created February 25, 2018 18:41 — forked from Chandler/slack_history.py
Download Slack Channel/PrivateChannel/DirectMessage History
# MIT License
# Copyright (c) 2016 Chandler Abraham
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
@guicaro
guicaro / Java Cheat Sheet
Last active February 25, 2024 11:34
Things to run on a REPL
// Snippets of code that work in Java 8.
// I've compiled these based on problems solved at:
// leetcode.com, interviewbit.com, firecode.io, hackerrank.com
// I strongly recommend you get a Java REPL to play around with some of this code
// (https://github.com/albertlatacz/java-repl)
// You can also use the jshell to run all these commands
// All following lines can be run in a Java REPL
// Note: If you see multiple lines of code, it's better to paste each line separately, just sayin'