Skip to content

Instantly share code, notes, and snippets.

View pandafulmanda's full-sized avatar

Amanda Shih pandafulmanda

View GitHub Profile
@pandafulmanda
pandafulmanda / Python3 Virtualenv Setup.md
Last active March 12, 2024 15:59 — forked from akszydelko/Python3 Virtualenv Setup.md
Setting up and using Python3 Virtualenv on Mac

Python3 Virtualenv Setup

Requirements
  • Python 3
  • Pip 3
$ brew install python3
{
"statuses": [
{
"coordinates": null,
"favorited": false,
"truncated": false,
"created_at": "Mon Sep 24 03:35:21 +0000 2012",
"id_str": "250075927172759552",
"entities": {
"urls": [
@pandafulmanda
pandafulmanda / app.js
Last active December 12, 2018 01:04
Quick express body-parser vs built in json middleware example
const express = require('express')
const app = express()
app.use(express.json())
@pandafulmanda
pandafulmanda / sketch.js
Last active October 12, 2017 22:43 — forked from wnjnz/sketch.js
var red;
var green;
var blue;
var previousRed;
var previousGreen;
var previousBlue;
var song;
var keywidth = 50;
var keyheight = 300;
@pandafulmanda
pandafulmanda / airquality.csv
Last active November 4, 2016 15:01
Trying something with openCPU https://www.opencpu.org/api.html
Ozone Solar.R Wind Temp Month Day
41 190 7.4 67 5 1
36 118 8 72 5 2
12 149 12.6 74 5 3
18 313 11.5 62 5 4
NA NA 14.3 56 5 5
28 NA 14.9 66 5 6
23 299 8.6 65 5 7
19 99 13.8 59 5 8
8 19 20.1 61 5 9
require(ggplot2)
members <- jsonlite::fromJSON(readLines('https://gist.githubusercontent.com/neerajt/6f0ff957e7ff3adab63471460cade5d5/raw/55e3b7691aefe8e1c1dca7543dd4d41c8b5bee09/members.json'))
plt <- ggplot(members, aes(x=Date, y=TotalMembers)) +
geom_point() + geom_point(aes(y = ActiveMembers), color="red") +
geom_point(aes(y = TotalMembers - ActiveMembers), color="blue")
print(plt)
@pandafulmanda
pandafulmanda / git-logger.r
Last active September 1, 2016 15:17
Git Log script using r, a spin-off from watching https://www.youtube.com/watch?v=CB9p8n3gugM, no libs allowed. see also: https://gist.github.com/neerajt/4f04f3d7dd93b51dabbcac5e4a0b0456
GIT_PATH <- '.git'
PARENT_SEP <- 'parent '
get_log <- function() {
current_hash <- get_current_hash()
current_commit <- get_commit(current_hash)
all_commits <- c(format_commit(current_hash, current_commit))
# This is how you print in python
print('Hello, Houston')

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
@pandafulmanda
pandafulmanda / scrollspy.coffee
Last active December 30, 2015 02:19 — 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…
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)