Skip to content

Instantly share code, notes, and snippets.

View 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) {
View rethinkdb_fonts_in_use.sql
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 Mar 13, 2016
Squid configuration for reverse proxy and caching for store
View squid.conf
#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 Mar 12, 2016 — forked from hpcorona/squid.conf
simple squid3 configuration to allow all to connect to all
View squid.conf
#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 Oct 4, 2015
Hbase Truncate Keep Partitions
View truncate.sh
truncate_preserve 't1'
@terrancesnyder
terrancesnyder / TOOLS.md
Last active Sep 16, 2015
System Developer Startup
View TOOLS.md

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
View fixspaces.sh
find . -name '*.java' ! -type d -exec bash -c 'expand -t 4 "$0" > /tmp/e && mv /tmp/e "$0"' {} \;
View kafka-kill.sh
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
Sankey Barchart with D3
View README.md

Sankey Barchart

Info

Provides a visualization similar to google analytics shopper behavior analytics.

Requires

  • d3js
  • underscorejs
@terrancesnyder
terrancesnyder / gist:b4ef1acd7494b1b9aa78
Last active Aug 29, 2015
Useful bash for clearing solr index data
View gist:b4ef1acd7494b1b9aa78
shopt -s globstar
find ./consumers_s*/**/data/* -type f -exec rm -rf {} \;
find ./consumers_s*/**/tlog/* -type f -exec rm -rf {} \;
find ./orders_s*/**/data/* -type f -exec rm -rf {} \;
find ./orders_s*/**/tlog/* -type f -exec rm -rf {} \;