Skip to content

Instantly share code, notes, and snippets.

@terrancesnyder
terrancesnyder / vagrant_reset_network.sh
Created May 16, 2016 20:44
Reset Vagrant Networking
sudo ifdown --exclude=lo -a && sudo ifup --exclude=lo -a
@terrancesnyder
terrancesnyder / rethinkdb_merge_pushdown_crazy.js
Created April 7, 2016 23:52
rethinkdb_merge_pushdown_crazy.js
r.db('test')
.table('templates')
.filter({ network: { id: 'USA-0034' } })
.concatMap(function(d) {
return d('layers').do(function(l) {
return l.merge({ template: d('id') })
});
})
.filter({ image_var: 'product_shot_url' })
.map(function(d) {
r.db('test').table('templates').filter({ network: { id: "USA-0008" } }).getField('layers').filter(function(v) {
return v('object').hasFields('fontFamily')
}).concatMap(function(v) {
return v('object')('fontFamily')
}).distinct()
@terrancesnyder
terrancesnyder / squid.conf
Created March 13, 2016 01:16
Squid configuration for reverse proxy and caching for store
#Recommended minimum configuration:
acl manager proto cache_object
acl localhost src 127.0.0.1/32
acl to_localhost dst 127.0.0.0/8
acl localnet src 0.0.0.0/8 192.168.100.0/24 192.168.101.0/24
acl SSL_ports port 443
acl Safe_ports port 80 # http
acl Safe_ports port 21 # ftp
acl Safe_ports port 443 # https
@terrancesnyder
terrancesnyder / squid.conf
Created March 12, 2016 22:43 — forked from hpcorona/squid.conf
simple squid3 configuration to allow all to connect to all
#Recommended minimum configuration:
acl manager proto cache_object
acl localhost src 127.0.0.1/32
acl to_localhost dst 127.0.0.0/8
acl localnet src 0.0.0.0/8 192.168.100.0/24 192.168.101.0/24
acl SSL_ports port 443
acl Safe_ports port 80 # http
acl Safe_ports port 21 # ftp
acl Safe_ports port 443 # https
acl Safe_ports port 70 # gopher
@terrancesnyder
terrancesnyder / truncate.sh
Created October 4, 2015 22:00
Hbase Truncate Keep Partitions
truncate_preserve 't1'
@terrancesnyder
terrancesnyder / TOOLS.md
Last active September 16, 2015 15:47
System Developer Startup

Java/JDK

  • Download JDK 1.7 (JDK!!!)
  • Install to C:\opt\java\jdk1.7.xx install your JRE to C:\opt\java\jre1.7.xx
  • Update your environment to have JAVA_HOME = C:\opt\java\jdk1.7.xx and update your root to have PATH = ...;%JAVA_HOME%\bin
  • Validate you did it right by going to your shell and typing "java -version" You should get java version info.

Maven

  • Download and install the latest maven to C:\opt\maven
find . -name '*.java' ! -type d -exec bash -c 'expand -t 4 "$0" > /tmp/e && mv /tmp/e "$0"' {} \;
@terrancesnyder
terrancesnyder / kafka-kill.sh
Last active July 20, 2016 13:38
Kafka 0.8.x Fix
sudo su
echo "Shutting down sync server... try 1"
service kafka-sync stop
sleep 2
echo "Shutting down sync server... try 2"
service kafka-sync stop
sleep 2
echo "Shutting down server... try 1"
service kafka-server stop
sleep 2
@terrancesnyder
terrancesnyder / README.md
Last active May 26, 2020 08:07
Sankey Barchart with D3

Sankey Barchart

Info

Provides a visualization similar to google analytics shopper behavior analytics.

Requires

  • d3js
  • underscorejs