import os
# To get the directory of the script/file:
current_dir = os.path.dirname(os.path.realpath(__file__))
# To get one directory up from the current file
parent_dir = os.path.abspath(os.path.join(current_dir, ".."))
See how a minor change to your commit message style can make a difference.
git commit -m"<type>(<optional scope>): <description>" \ -m"<optional body>" \ -m"<optional footer>"
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
case class SessionInfo(sessionStartTimestampMs: Long, | |
sessionEndTimestampMs: Long, | |
numEvents: Int) { | |
/** Duration of the session, between the first and last events + session gap */ | |
def durationMs: Long = sessionEndTimestampMs - sessionStartTimestampMs | |
} | |
case class SessionUpdate(id: String, | |
sessionStartTimestampSecs: Long, |
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
case class SessionInfo(sessionStartTimestampMs: Long, | |
sessionEndTimestampMs: Long, | |
numEvents: Int) { | |
/** Duration of the session, between the first and last events + session gap */ | |
def durationMs: Long = sessionEndTimestampMs - sessionStartTimestampMs | |
} | |
case class SessionUpdate(id: String, | |
sessionStartTimestampSecs: Long, |
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 net.heartsavior; | |
import java.lang.reflect.Constructor; | |
import java.lang.reflect.Field; | |
import java.lang.reflect.Method; | |
public class ClassInvestigator { | |
public static void main(String[] args) { | |
if (args.length < 1) { |
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
aws s3 sync s3://nyc-tlc . --no-sign-request --exclude "*" --include "trip data*" |
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 com.fasterxml.jackson.databind.JsonNode; | |
import com.fasterxml.jackson.databind.node.ObjectNode; | |
import org.apache.kafka.common.serialization.Serdes; | |
import org.apache.kafka.streams.KafkaStreams; | |
import org.apache.kafka.streams.StreamsBuilder; | |
import org.apache.kafka.streams.StreamsConfig; | |
import org.apache.kafka.streams.Topology; | |
import org.apache.kafka.streams.kstream.GlobalKTable; | |
import org.apache.kafka.streams.kstream.KStream; | |
import org.apache.kafka.streams.kstream.Materialized; |
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
### prerequisites | |
sudo yum groupinstall "Development Tools" | |
git --version | |
gcc --version | |
bash --version | |
python --version # (system) | |
sudo yum install -y openssl-devel readline-devel zlib-devel | |
sudo yum update | |
### install `pyenv` |
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 | |
diff=$(cargo fmt -- --check) | |
result=$? | |
if [[ ${result} -ne 0 ]] ; then | |
cat <<\EOF | |
There are some code style issues, run `cargo fmt` first. | |
EOF | |
exit 1 |
Here is a high level overview for what you need to do to get most of an Android environment setup and maintained.
Prerequisites (for Homebrew at a minimum, lots of other tools need these too):
- XCode is installed (via the App Store)
- XCode command line tools are installed (
xcode-select --install
will prompt up a dialog) - Java
Install Homebrew:
ruby -e "$(curl -fsSL https://raw.github.com/Homebrew/homebrew/go/install)"