Skip to content

Instantly share code, notes, and snippets.

View ixaxaar's full-sized avatar
🏔️

ixaxaar ixaxaar

🏔️
View GitHub Profile
@ixaxaar
ixaxaar / CorsSupport.scala
Last active September 18, 2015 13:16 — forked from joseraya/CorsSupport.scala
CORS directive for Spray
package com.agilogy.spray.cors
import spray.http.{HttpMethods, HttpMethod, HttpResponse, AllOrigins}
import spray.http.HttpHeaders._
import spray.http.HttpMethods._
import spray.routing._
// see also https://developer.mozilla.org/en-US/docs/Web/HTTP/Access_control_CORS
trait CORSSupport {
this: HttpService =>
@ixaxaar
ixaxaar / event_export.py
Created February 23, 2016 14:18 — forked from drmarshall/event_export.py
Example Mixpanel raw event export script
#! /usr/bin/env python
#
# Mixpanel, Inc. -- http://mixpanel.com/
#
# Python API client library to consume mixpanel.com analytics data.
import hashlib
import urllib
import time
try:
@ixaxaar
ixaxaar / pmap
Created February 24, 2016 08:09
pmap output
11482: java -jar -Xmx10G -XX:+UseG1GC -XX:MaxGCPauseMillis=100 -XX:MinHeapFreeRatio=30 -XX:MaxHeapFreeRatio=50 -Dkamon.auto-start=true -javaagent:/home/ubuntu/.ivy2/cache/org.aspectj/aspectjweaver/jars/aspectjweaver-1.8.2.jar /home/ubuntu/cerebro.jar 0.0.0.0 9998
0000000000400000 4K r-x-- java
0000000000600000 4K rw--- java
0000000001577000 860K rw--- [ anon ]
0000000540000000 7823360K rw--- [ anon ]
000000071d800000 2662400K ----- [ anon ]
00000007c0000000 10240K rw--- [ anon ]
00000007c0a00000 1038336K ----- [ anon ]
00007f06f9d86000 148040K r--s- _1zg.fdt
00007f0724bad000 14104K r--s- _1zg_Lucene50_0.tim
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@ixaxaar
ixaxaar / inception_v3.py
Created July 5, 2016 10:38 — forked from neggert/inception_v3.py
Inception-v3 implementation in Keras
from keras.models import Model
from keras.layers import (
Input,
Dense,
Flatten,
merge,
Lambda
)
from keras.layers.convolutional import (
Convolution2D,
curl -v https://dl.bintray.com/sbt/sbt-plugin-releases/org.apache.commons/commons-parent/32/jars/commons-parent.jar
* Trying 108.168.243.150...
* Connected to dl.bintray.com (108.168.243.150) port 443 (#0)
* found 173 certificates in /etc/ssl/certs/ca-certificates.crt
* found 704 certificates in /etc/ssl/certs
* ALPN, offering http/1.1
* gnutls_handshake() failed: Error in the pull function.
* Closing connection 0
curl: (35) gnutls_handshake() failed: Error in the pull function.

Traversals

Traversal[S,E] which implements Iterator[E] where S:Start, E:End

Step[S,E] //  an individual function applied to S to yield E . Steps are chained within a traversal.
TraversalStrategy // interceptor methods to alter the execution of the traversal (e.g. query re­writing).
TraversalSideEffects // key/value pairs that can be used to store global information about the traversal.
Traverser[T] // the object propagating through the Traversal currently representing an object of type T .
@ixaxaar
ixaxaar / install_cassandra.sh
Created September 2, 2016 06:01
Multi-DC cassandra installer
#!/usr/bin/env bash
# A script to install cassandra
# Deploy a few instances as seed nodes first, this script can run on those seed nodes as well
# Number of seed nodes equal number of data centers
# Add the seed nodes here
SEEDS[0]='172.31.40.98'
SEEDS[1]='172.31.40.99'
SEEDS[2]='172.31.40.100'
def beam[T](
data:List[List[T]],
perplexityFn: List[T] => Double,
startNode:T,
beamSize:Int = 10)
:List[(List[T], Double)] = {
var candidates = List((List(startNode), 0d))
data.foreach{ case datum:List[T] =>