View timeout.js
/** | |
* Accepts a promise and a timeout. If the timeout reached while the promise is stil pending, it rejects with a timeout. | |
* @param timeout in milli | |
* @param promise | |
*/ | |
Promise.timeout = (timeout, promise) => { | |
let bombId; | |
Promise.race([ | |
promise, | |
new Promise((resolve, reject) => { |
View logstash.conf
input { | |
beats { | |
port => 5044 | |
} | |
} | |
filter { | |
if [type] == "beat" { | |
mutate { | |
remove_field => ["type", "beat", "input_type", "offset", "source", "fields"] |
View semanticVersionComparator.js
/** | |
* Created by david on 17/1/16. | |
*/ | |
/** | |
* Compares two version numbers that follow the semantic version standard. | |
* Compares only the first 3 elements (major, minor and patch). | |
* Separator can be '.' or '-'. | |
* If a>b, returns 1 | |
* If a<b, returns -1 |
View nginx-configuration
server { | |
listen 80; | |
server_name domain.com; | |
auth_basic "Restricted Access"; | |
auth_basic_user_file /etc/nginx/htpasswd.users; | |
location / { | |
proxy_pass http://localhost:5601; |
View logstash.conf
input { | |
file { | |
path => "/var/log/kwik/kwik.log" | |
codec => json | |
start_position => beginning | |
} | |
} | |
output { | |
elasticsearch { | |
hosts => "localhost:9200" |
View BuildLog
Setting top to : /tmp/tmpctNwIM | |
Setting out to : /tmp/tmpctNwIM/build | |
Checking for program gcc,cc : arm-none-eabi-gcc | |
Checking for program ar : arm-none-eabi-ar | |
Found Pebble SDK in : /app/sdk2/Pebble | |
'configure' finished successfully (0.052s) | |
Waf: Entering directory `/tmp/tmpctNwIM/build' | |
[ 1/29] appinfo.auto.c: appinfo.json -> build/appinfo.auto.c | |
[ 2/29] menu_icon.png.pbi: resources/images/menu_icon.png ../../app/sdk2/Pebble/tools/bitmapgen.py -> build/resources/images/menu_icon.png.pbi | |
[ 3/29] logo_splash.png.pbi: resources/images/logo_splash.png ../../app/sdk2/Pebble/tools/bitmapgen.py -> build/resources/images/logo_splash.png.pbi |
View .gitconfig
[user] | |
name = David Raviv | |
email = david.raviv@worldmate.com | |
[core] | |
autocrlf = input | |
[credential] | |
helper = osxkeychain | |
[color] | |
ui = auto |
View LocationChanger.plist
<?xml version="1.0" encoding="UTF-8"?> | |
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" | |
"http://www.apple.com/DTDs/PropertyList-1.0.dtd"> | |
<plist version="1.0"> | |
<dict> | |
<key>Label</key> | |
<string>locationchanger</string> | |
<key>ProgramArguments</key> | |
<array> | |
<string>/Users/davidraviv/bin/locationchanger</string> |
View ip.sh
#! /bin/bash | |
ip_lines=`ifconfig | grep "inet "` | |
prefix="*inet " | |
suffix=" net*" | |
while read -r line; do | |
ip=${line##$prefix} | |
ip=${ip%%$suffix} | |
echo "$ip" | |
done <<< "$ip_lines" |
View HTTPMessage.java
package com.x.proxy.http; | |
import java.io.Serializable; | |
import java.util.Map; | |
/** | |
* Created by davidraviv on 7/5/14. | |
*/ | |
public class HTTPMessage implements Serializable { | |
public String url; |
NewerOlder