Skip to content

Instantly share code, notes, and snippets.

var el = d3.select('.vis'),
elWidth = parseInt(el.style('width'), 10),
elHeight = parseInt(el.style('height'), 10),
margin = {top: 20, right: 20, bottom: 30, left: 50},
width = elWidth - margin.left - margin.right,
height = elHeight - margin.top - margin.bottom;
var svg = el.append("svg")
.attr("width", elWidth)
// var data = [
// {
// "browser":"Chrome",
// "value": "45"
// },
// {
// "browser":"Safari",
// "value":"12"
// },
d3.select("#selections")
.append("p")
.text("New paragraph!");
.directive('scrollPosition', ['$window', function($window) {
return {
scope: {
target: '=scrollPosition'
},
link: function (scope, element) {
// Detect request animation frame
var scroll = window.requestAnimationFrame ||
window.webkitRequestAnimationFrame ||
window.mozRequestAnimationFrame ||
@victormejia
victormejia / gist:9563967d63f8a8b4c371
Last active August 29, 2015 14:19
victor_wish_list.md
  • D3
  • MomentJS for date manipulation
  • lodash very useful functional helpers or Underscore is good also
  • GitHub Fetch API polyfill cool library for http, although angular's $http should be fine
  • Chart.js charting library, easy to use api, however it's canvas, not SVG
.highlight { background: #ffffff; }
.highlight .c { color: #999988; font-style: italic } /* Comment */
.highlight .err { color: #a61717; background-color: #e3d2d2 } /* Error */
.highlight .k { font-weight: bold } /* Keyword */
.highlight .o { font-weight: bold } /* Operator */
.highlight .cm { color: #999988; font-style: italic } /* Comment.Multiline */
.highlight .cp { color: #999999; font-weight: bold } /* Comment.Preproc */
.highlight .c1 { color: #999988; font-style: italic } /* Comment.Single */
.highlight .cs { color: #999999; font-weight: bold; font-style: italic } /* Comment.Special */
.highlight .gd { color: #000000; background-color: #ffdddd } /* Generic.Deleted */
describe('Portfolio Module', function () {
var DesignerContextSvc, $httpBackend, authRequestHandler, path, adTypeId = 1;
var metadata = {
collection: [{
name: "leaderboard",
label: "Leaderboard",
units: [{
name: "desktop",

Set up (assuming you have Node and NPM installed)

npm install -g karma
npm install -g karma-cli

If you get any MS build errors, set the msvs version, and run again:

npm config set msvs_version 2013 --global

Setting up new project

public static string PostRequest(Uri serviceReqUrl, string jsonData, Dictionary<string, string> additionalHeaders, out System.Net.HttpStatusCode statusCode)
{
HttpResponseMessage response = null;
try
{
using (HttpClient client = new HttpClient())
{
HttpContent content = new System.Net.Http.StringContent(jsonData, System.Text.Encoding.UTF8, "application/json");
if (additionalHeaders != null)
{
function sendFile = function (el) {
scope.uploading = true;
var filename = $('#inputElement').val(),
fObj = el.files[0];
if (f == '') {
return false;
}
var fPart = filename.split('\\'),
origFilename = fPart[fPart.length - 1];