Skip to content

Instantly share code, notes, and snippets.

Avatar

Amanda Shih pandafulmanda

View GitHub Profile
@pandafulmanda
pandafulmanda / gist:8722454
Created Jan 30, 2014
Quick gist to avoid errors when console.log is undefined in non-supported (ahem IE 9) browsers
View gist:8722454
if(typeof window.console == "undefined" || typeof console.log =="undefined") {window['console'] = {}; window.console['log'] = function(){};}
View d3-intro-step-00.html
<html>
<head>
<script src="http://d3js.org/d3.v3.min.js"></script>
</head>
<body>
<svg width="960" height="500"></svg>
</body>
</html>
View d3-intro-step-01.html
<html>
<head>
<script src="http://d3js.org/d3.v3.min.js"></script>
</head>
<body>
<svg width="960" height="500"></svg>
<script>
d3.select("svg")
View d3-intro-step-03.html
<html>
<head>
<script src="http://d3js.org/d3.v3.min.js"></script>
</head>
<body>
<svg width="960" height="500"></svg>
<script>
var sampleData = [1, 2, 3, 4, 5];
View d3-intro-step-02.html
<html>
<head>
<script src="http://d3js.org/d3.v3.min.js"></script>
</head>
<body>
<svg width="960" height="500"></svg>
<script>
var sampleData = [1, 2, 3, 4, 5];
@pandafulmanda
pandafulmanda / d3-intro-step-04.html
Created Nov 9, 2015
fit to window size and use scales
View d3-intro-step-04.html
<html>
<head>
<script src="http://d3js.org/d3.v3.min.js"></script>
</head>
<body>
<svg></svg>
<script>
var sampleData = [1, 2, 3, 4, 5, 10, 6, 2, 9, 20, 54, 30];
@pandafulmanda
pandafulmanda / bob
Last active Dec 21, 2015
A solution Bob in exercism.io
View bob
class Bob
def hey (message)
all_cases = {:silence? => 'Fine. Be that way!', :yelling? => 'Woah, chill out!', :asking? => 'Sure.'}
response = all_cases.keys.find do |meth_name|
send(meth_name, message)
end
@pandafulmanda
pandafulmanda / scrollspy.coffee
Last active Dec 30, 2015 — forked from alxhill/scrollspy.coffee
fork of alxhill's scrollspy.coffee at https://gist.github.com/alxhill/6886760 not sure why, but the original wasn't working for me when the scope model updated. spyElems[spy.id] was undefined for new elements at line 37 and caused scrollfix to break after a model change. am using v1.2.0-8336b3a also add a quick attribute to allow easy custom buf…
View scrollspy.coffee
angular.module('jobFoundryDirectives').directive 'spy', ($location) ->
restrict: "A"
require: "^scrollSpy"
link: (scope, elem, attrs, scrollSpy) ->
attrs.spyClass ?= "current"
elem.click ->
scope.$apply ->
$location.hash(attrs.spy)
View knitr-HRUG-notes.md

knitr

HRUG Meetup

Why Knitr

  • results need to be reproducible
  • Documentation of code
    • easier to read and understand later on to extend
  • Great for making reports as well
  • Sharing results leads to facilitating discussion