Skip to content

Instantly share code, notes, and snippets.

Jon Austen djangofan

View GitHub Profile
View small_taxi.csv
vendor_id pickup_datetime dropoff_datetime passenger_count trip_distance pickup_longitude pickup_latitude rate_code store_and_fwd_flag dropoff_longitude dropoff_latitude payment_type fare_amount extra mta_tax tip_amount tolls_amount imp_surcharge total_amount pickup_location_id dropoff_location_id
2 2017-09-23 05:08:42 2017-09-23 05:27:39 6 9.38 1 N 1 27.5 0.5 0.5 3.5 0 0.3 32.3 87 41
1 2017-07-14 19:07:38 2017-07-14 19:54:17 1 9.7 1 N 1 36 1 0.5 7.55 0 0.3 45.35 162 188
2 2017-10-29 00:42:06 2017-10-29 00:43:12 2 0.09 1 N 3 -3 -0.5 -0.5 0 0 -0.3 -4.3 164 164
2 2017-10-02 20:38:17 2017-10-02 21:13:09 1 12.4 1 N 1 38 0.5 0.5 7.86 0 0.3 47.16 48 130
1 2017-05-11 22:53:11 2017-05-11 23:27:53 2 7.9 1 N 1 29.5 0.5 0.5 6.15 0 0.3 36.95 163 25
@djangofan
djangofan / JedisServiceImpl.java
Created Oct 8, 2018
Example of JedisServiceImpl class in Java.
View JedisServiceImpl.java
package com.tb.services;
import java.util.Collection;
import java.util.List;
import java.util.Map;
import java.util.Set;
import java.util.concurrent.TimeUnit;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.redis.core.RedisTemplate;
@djangofan
djangofan / .bash_profile.sub.sh
Last active Sep 1, 2018
LIB SETUP IN OSX MAC .bash_profile
View .bash_profile.sub.sh
# put in .bash_profile
export PATH=".:/usr/local/bin:/usr/local:/usr/local/sbin:/usr/bin:/usr/sbin:/bin:/sbin:/sw/bin:$PATH"
export PATH="$PATH:/usr/local/git/bin"
export PATH="$PATH:$HOME/.pyenv/shims" # add Python version manager 'brew install pyenv'
eval "$(pyenv init -)"
echo "Python shimmed: " + $(pyenv which python)
export PATH="$PATH:$HOME/.rbenv/bin" # add Ruby version manager 'brew install rbenv'
eval "$(rbenv init -)"
echo "Ruby shimmed: " + $(rbenv which ruby)
# install SDKMAN 'curl -s "https://get.sdkman.io" | bash'
@djangofan
djangofan / QueryManager.java
Created Jul 19, 2018
An example of QueryManager in Java for JPA
View QueryManager.java
import javax.persistence.EntityManager;
import javax.persistence.Query;
import java.util.HashMap;
import java.util.Map;
public class QueryBuilder {
private final EntityManager entityManager;
private final Map<String, Object> parameters = new HashMap<>();
private String resultSetMapping;
private String query;
@djangofan
djangofan / Dockerfile
Created Jul 19, 2018
Install AWS CLI on docker container
View Dockerfile
FROM tomcat:8.5-jre8-alpine
#Metadata
LABEL version="1.0-SNAPSHOT"
LABEL description="Run ss a service"
#Install AWS CLI
RUN apk update && \
apk add --no-cache python tar && \
python -m ensurepip && \
@djangofan
djangofan / Tracert.java
Last active Jun 14, 2019
Traceroute in Java
View Tracert.java
import java.io.IOException;
import java.net.Inet4Address;
import java.net.InetAddress;
import java.net.MalformedURLException;
import java.net.URL;
import java.net.UnknownHostException;
import java.util.Arrays;
import jpcap.JpcapCaptor;
import jpcap.JpcapSender;
@djangofan
djangofan / socat-config.sh
Last active Mar 18, 2018
socat daemon on OSX for Docker
View socat-config.sh
#!/bin/bash
#brew install socat
# socat TCP-LISTEN:2377,reuseaddr,fork UNIX-CONNECT:/var/run/docker.sock
#file: docker.socat_listener
# <?xml version="1.0" encoding="UTF-8"?>
# <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
# <plist version="1.0">
# <dict>
@djangofan
djangofan / .bash_profile
Last active Feb 21, 2018 — forked from natelandau/.bash_profile
Mac OSX Bash Profile for Developers
View .bash_profile
# ---------------------------------------------------------------------------
#
# Description: This file holds all my BASH configurations and aliases
#
# Sections:
# 1. Environment Configuration
# 2. Make Terminal Better (remapping defaults and adding functionality)
# 3. File and Folder Management
# 4. Searching
# 5. Process Management
View minor-swing.json
{
"title": "Minor Swing",
"author": "Django Reinhardt",
"key": "Am",
"content": [ ["Am", "Am", "Dm", "Dm", "E7", "E7", "Am", "Am"], ["Dm", "Dm", "Am", "Am", "F7", "E7", "Am", "E7"] ]
}
You can’t perform that action at this time.