Skip to content

Instantly share code, notes, and snippets.

View pamelafox's full-sized avatar

Pamela Fox pamelafox

View GitHub Profile
@pamelafox
pamelafox / ThinkBeforeYouTweet.js
Last active June 2, 2018 17:23
ThinkBeforeYouTweet - a Nudge for HabitLab to prompt reflection before tweeting
// Nudge for twitter.com for HabitLab
// You can use it by installing HabitLab for Chrome,
// and then in settings, click Code your own Nudge and paste this code in
// TODOS:
// Make a version for TweetDeck
// Remove nudgeContainer once tweet is successfully sent
const $ = require('jquery');
require_component('habitlab-logo-v2');
@pamelafox
pamelafox / MediumFeedEater.js
Created March 8, 2018 18:47
Medium Feed Eater for HabitLab
const $ = require('jquery');
require_component('habitlab-logo-v2');
require_component('paper-button');
function removeFeed() {
var re = new RegExp('medium.com\/\??.*$');
if (!re.test(window.location.href)) {
return;
}
$('.streamItem').css('display', 'none');
@pamelafox
pamelafox / PULL_REQUEST_TEMPLATE.md
Created December 7, 2017 22:04
The pull request template for Woebot.

High-level description of change

Why you made these changes (how it helps us or our users)

Are there performance implications for this change?

REPLACE THIS: Please profile using time/timeEnd any potentially time-taking changes. Then profile using node profiler to identify what aspects take most time.

Have you added tests to cover this new/updated code?

@pamelafox
pamelafox / GithubClient.gs
Created May 12, 2017 20:51
Google Apps Script for committing a file to Github Repo
/* A bare-bones GithubClient, just used for commits */
function GithubClient(owner, repo, username, passwordOrToken) {
this.owner = owner;
this.repo = repo;
this.username = username;
this.passwordOrToken = passwordOrToken;
}
/*
@pamelafox
pamelafox / interview.md
Last active January 28, 2018 05:52
Interview answers

A Khan Academy student asked me these questions as part of a school project.

  • What is the hardest part about making a website with javascript?

Hmm. It gets tricky once your website starts having a LOT of JavaScript - you have to truly make sure to keep it clean and well organized. Otherwise you end up with what we call "spaghetti code" - a jumble of code that might work but is so hard for you or anyone else to make sense of. It's even more important to organize your code if you're working with other people, so you make sure that you all organize your code the same way and that every bit of code goes in the place it belongs.

Another aspect that can be hard is performance, especially for websites that use a lot of JavaScript. Sometimes the browser slows down when it's trying to execute all the JavaScript, particularly if the code is requesting "repaints" of the browser window - if it's moving or changing visible things on the page. There are now a lot of tools that you can use to analyze the performance o

@pamelafox
pamelafox / hopper.css
Created October 15, 2015 21:26
Hopper.css
body {
background: rgb(215, 250, 220);
font-family: sans-serif;
}
.header {
background-color: rgb(36, 89, 36);
color: white;
padding: 5px 10px;
}
@pamelafox
pamelafox / magnifico.html
Created July 18, 2015 15:43
magnifico example
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>New Webpage</title>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/magnific-popup.js/1.0.0/magnific-popup.css">
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script>
<script src="
https://cdnjs.cloudflare.com/ajax/libs/magnific-popup.js/1.0.0/jquery.magnific-popup.js"></script>
<a class="image-link" href="https://www.kasandbox.org/programming-images/animals/butterfly.png">Open popup!</a>
@pamelafox
pamelafox / slideshow.js
Last active June 29, 2016 23:20
slideshow.js
/**
* This function takes in a reference to a DOM element,
* assumes each of its children are <img> tags,
* and then makes a simple slideshow out of the images.
* @param container A DOM element
*/
var slideShow = function(container) {
this.images = [];
this.curImage = 0;
for (i = 0; i < container.childElementCount; i++) {
@pamelafox
pamelafox / programming_languages.sql
Last active June 2, 2018 17:26
programming_languages.sql
/* Programming languages
Collected by: https://www.khanacademy.org/profile/trekcelt/programs
*/
CREATE TABLE languages(
id INTEGER PRIMARY KEY,
name TEXT,
primary_developer TEXT,
launched INTEGER,
oop INTEGER /* Whether or not they're Object-oriented */
);
@pamelafox
pamelafox / nfl_picks.sql
Last active November 13, 2024 06:23
nfl_picks.sql
/*
1st 3 rounds of the NFL 2015 Draft
Collected by: https://www.khanacademy.org/profile/BobbyandKaren/
*/
CREATE TABLE picks(
id INTEGER PRIMARY KEY,
pick_number INTEGER,
name TEXT,
college TEXT,