Skip to content

Instantly share code, notes, and snippets.

View dustinmyers's full-sized avatar

Dustin Myers dustinmyers

View GitHub Profile
<script src=""></script>
$(function() {
app.controller('MainCtrl', function($scope, URL, $firebaseObj) {
// Normally we would handle data inside a service or factory... but for the
// example, we keep it short and simple, and hard code it into the controller.
$ = [
{name: "Dustin", from:"Idaho", hobbies: ["Snowboarding", "Coding"]},
{name: "Brendan", from:"Utah", hobbies: ["Airsoft", "Writing"]},
{name: "Adriana", from:"Mexico", hobbies: ["Sleeping", "Bird Watching"]},
{name: "Andy", from:"Ogden", hobbies: ["Skiing", "Dirt Scootering"]}
/////// FIREBASE OBJECTS ///////////
var ref = new Firebase(URL);
var obj = $firebaseObj(ref);
console.log("obj: ", obj);
console.log("obj.numbers before $loaded: ", obj.numbers);
obj.$loaded().then(function() {
console.log("obj.numbers after $loaded: ", object.numbers);
$scope.numbers = obj.numbers;
@import url(|Exo+2:300,600);
/* Eric Meyer's Reset CSS v2.0 - */
/* Solarized Palette - ---------
lightgray : #819090;
gray : #70
var teamAvengers = [
"id": 1009368,
"name": "Iron Man",
"description": "Wounded, captured and forced to build a weapon by his enemies, billionaire industrialist Tony Stark instead created an advanced suit of armor to save his life and escape captivity. Now with a new outlook on life, Tony uses his money and intelligence to make the world a safer, better place as Iron Man.",
"modified": "2013-11-07T10:55:38-0500",
"thumbnail": {
"path": "",
"extension": "jpg"
dustinmyers /
Last active May 24, 2018 16:05
Node II


Work through node-express-mini

  • CRUD
    • Create
    • Read
    • Update
    • Delete
  • REST
    • GET
  • PUT
// Create a function called MakePerson which takes in name, birthday, ssn as its parameters and returns a new object with all of the information that you passed in.
function MakePerson(name, bday, ssn) {
var person = {}; = name;
person.bday = bday;
person.ssn = ssn;
return person;
dustinmyers / [pid].jsx
Last active April 26, 2022 05:36
Example of how to use serverless functions to fetch data from a CMS for a blog site
// Blog page that fetches data using serverless function
import { useEffect, useState } from "react";
import { useRouter } from "next/router";
import ReactMarkdown from "react-markdown";
import Loader from "../../components/Loader";
export default function BlogPost() {
const router = useRouter();
dustinmyers / todo.controller.ts
Created April 26, 2022 14:58
Todo App example in NestJS - a Node framework inspired heavily by Angular
import {
} from '@nestjs/common';
import { toPromise } from 'src/shared/utils';
dustinmyers / ThemeContext.jsx
Last active April 26, 2022 15:12
Initial function and context object for dark mode in a NextJS SSR App - To avoid the SSR dark mode "flicker", set styles on the root before the site is rendered. CSS variables are key here.
import React from "react";
import {
} from "../themes/cssVariables";
export const UserThemeContext = React.createContext()