Skip to content

Instantly share code, notes, and snippets.

View venkatd's full-sized avatar

Venkat Dinavahi venkatd

View GitHub Profile
- turtle project
-- venkat's this week
---- task a
---- task b
-- vlad's this week
---- task q
---- task r
@venkatd
venkatd / test.html
Last active February 24, 2016 02:27
<!DOCTYPE html>
<html class='223792 no-js'>
<head>
<script type="text/javascript">window.NREUM||(NREUM={});NREUM.info={"beacon":"bam.nr-data.net","errorBeacon":"bam.nr-data.net","licenseKey":"4e6cb914c3","applicationID":"2869562","transactionName":"el9WQBMJWw1WER8UC0pESxsSDlgW","queueTime":1,"applicationTime":35,"agent":""}</script>
<script type="text/javascript">window.NREUM||(NREUM={}),__nr_require=function(t,e,n){function r(n){if(!e[n]){var o=e[n]={exports:{}};t[n][0].call(o.exports,function(e){var o=t[n][1][e];return r(o||e)},o,o.exports)}return e[n].exports}if("function"==typeof __nr_require)return __nr_require;for(var o=0;o<n.length;o++)r(n[o]);return r}({QJf3ax:[function(t,e){function n(){}function r(t){function e(t){return t&&t instanceof n?t:t?a(t,i,o):o()}function c(n,r,o){t&&t(n,r,o);for(var i=e(o),a=f(n),c=a.length,u=0;c>u;u++)a[u].apply(i,r);return i}function u(t,e){p[t]=f(t).concat(e)}function f(t){return p[t]||[]}function s(){return r(c)}var p={};return{on:u,emit:c,create:s,listeners:f,context
configByRole =
dsp:
sections: ['dashboard', 'exchange', 'xpublisher', 'campaign', 'ad']
reports:
dashboard:
type: "dashboard"
title: "Dashboard"
dimension: "account_name"
drill_down: "exchange"
exchange:
def apply_virtual_filters(operators)
# loop through operators (mix of virtual and real operators)
# if an operator is virtual, convert it to a real operator
# return new list of operators
end
FilterOperator = Struct.new(:type, :value)
def coerce_filters_to_operators(vals)
operators = build_filter_operators(vals)
class Tasks < Roda
route do |r|
r.on 'tasks' do
authenticate!
r.get do
# ...
end
r.get ':id' do
{
"nodes": [
{
"name": "localhost",
"root": ".",
"tasks": [
{
"name": "ad-server",
"root": ".",
"path": "build/x86_64/bin/adserver_runner",
@venkatd
venkatd / episode.js
Created August 26, 2015 21:00
Behavior for jumping to the right place when you click on a time
$(document.body).ready(function(){
window.addEventListener("hashchange", forwardAudioForHash, false);
$("#simplecast-audio-player").bind("jPlayer_loadstart", forwardAudioForHash)
$("#simplecast-audio-player").bind("jPlayer_waiting", showLoading)
$("#simplecast-audio-player").bind("jPlayer_playing", hideLoading)
$("#simplecast-audio-player").bind("jPlayer_pause", hideLoading)
$('.player a.jp-loading').click(function(){
$("#simplecast-audio-player").jPlayer("pause", seconds);
});

What did I get done yesterday?

What's left for this week and what's my plan for today?

Am I on track to finish everything for this sprint? If not, why?

Anything that you need from others on the team that might have gotten lost?

Action steps

Development

Top-down, what-if development

You want to write code from the top down. You start with the highest level code. Those one or two lines of code that will make everything work. Then you write what you would want and write your code that way. Because you are going top down, you're creating objects that don't exist and calling nonexistent methods on them. Doing this lets you define the usage before building the thing. Then you go down a level and repeat this process.

Your code as a product

You want to think of the methods you write, the objects you create, the APIs you design, and everything else as a product. Even if it's just you using it, imagine someone else will use it. This will lead to question such as

  • Does this name make sense? Or is it obvious?
  • How much work is it to use this? Am I creating an unnecessary burden on the user? Could I make this easier to use?
  • How would someone want this to work? Does it work the way they would want it? Can I move this a step further in th
var CustomFixtureAdapter = DS.FixtureAdapter.extend({
fixturesForType: function(type) {
if (!type.FIXTURES) {
type.FIXTURES = [];
}
return this._super(type);
},
createRecord: function() {
return this._super.apply(this, arguments);
},