Skip to content

Instantly share code, notes, and snippets.

@svp
svp / tv-menu-api.md
Last active January 21, 2022 17:02
tv menu api

devices

id,
hardware_id,
name,
location_id,
activation_code,
activated,
activation_time,

@svp
svp / uber-platform.txt
Last active July 29, 2016 11:34
Uber tech stack (platform)
Index of technologies/open source tools used in Uber platform (from https://eng.uber.com/tech-stack-part-one/):
Terraform
Postgres
Mysql
Riak
Cassandra
Hadoop
Redis
Twemproxy

Keybase proof

I hereby claim:

  • I am svp on github.
  • I am svp (https://keybase.io/svp) on keybase.
  • I have a public key whose fingerprint is B124 EDDE AD99 7BDB F74A B22F 9546 BDBF CCD6 E3D4

To claim this, I am signing this object:

@svp
svp / designer.html
Last active August 29, 2015 14:15
designer
<link rel="import" href="../google-map/google-map.html">
<link rel="import" href="../core-input/core-input.html">
<link rel="import" href="../paper-calculator/paper-calculator.html">
<link rel="import" href="../paper-progress/paper-progress.html">
<polymer-element name="my-element">
<template>
<style>
:host {
<?php
/**
* Normalise a file path string so that it can be checked safely.
*
* Attempt to avoid invalid encoding bugs by transcoding the path. Then
* remove any unnecessary path components including '.', '..' and ''.
*
* @param $path string
* The path to normalise.
* @param $encoding string
@svp
svp / jquery-unparam.js
Created May 13, 2013 08:28
URL Query string to object
jQuery.unparam = function (value) {
if(!value)
return false;
var params = {}, pieces = value.split('&'), pair, i, l;
for (i = 0, l = pieces.length; i < l; i++) {
pair = pieces[i].split('=', 2);
params[decodeURIComponent(pair[0])] = (pair.length == 2 ? decodeURIComponent(pair[1].replace(/\+/g, ' ')) : true);
}
return params;
};
@svp
svp / parse_access_log.sh
Last active December 16, 2015 19:50
Find entries in apache access log file within timespan
awk -vDate=`date -d '08:01' +[%d/%b/%Y:%H:%M:%S` -vDate2=`date -d'08:02' +[%d/%b/%Y:%H:%M:%S` ' { if ($4 > Date && $4 < Date2) print $1 $2 $3 $4 " " $7 " " $9}' access_log
awk -vDate=`date -d '04/29/2013 22:12:00' +[%d/%b/%Y:%H:%M:%S` -vDate2=`date -d'04/29/2013 22:13:00' +[%d/%b/%Y:%H:%M:%S` ' { if ( !match($7, "media|images|js|css|.ico") && ($9==404 || $9==301) ) print $1 $2 $3 $4 " " $7 " " $9}' access_log