Skip to content

Instantly share code, notes, and snippets.

View w3cj's full-sized avatar
🌱

CJ w3cj

🌱
View GitHub Profile
@w3cj
w3cj / app.js
Last active May 15, 2017 17:46
Disable buttons and show loading images/progress bars/ during long running activities.
$(appReady);
function appReady() {
setLoading(false);
$('form').submit(sendMessage);
}
let progressInterval = null;
function setLoading(isLoading) {
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title></title>
<link rel="stylesheet" href="style.css">
</head>
<body>
<main>
<container class="triangle-container">
<template>
<div class="hello">
<v-dialog v-model="modelOpen">
<v-btn primary dark slot="activator">Create Profile</v-btn>
<v-card>
<v-card-row>
<v-card-title>User Profile</v-card-title>
</v-card-row>
<v-card-row>
<v-card-text>
We couldn’t find that file to show.
@w3cj
w3cj / robot-and-batteries.md
Created April 18, 2017 14:39 — forked from bertoort/robot-and-batteries.md
Brain Teaser Warm-Up

Problem

A robotic technology startup is located in San Francisco. The CEO has 3000 battery packs that he wants to transport with Danny (the robotic bird) to his other branch, across a 1000-kilometer stretch of land. The owner has only one robotic bird, which carries a maximum of 1000 battery packs at any moment in time, and consumes one battery pack every kilometer it travels.

Question

What is the largest number of battery packs that can be delivered to the branch?

async/await

will change your life




By CJ R.

Lead Instructor @ Galvanize

AngularJS Scopes


Objectives

  • Define and describe module, controller and $scope
  • Set values on $scope to see them updated in the view
  • Define and describe $rootScope
const figlet = require('figlet');
require('colors');
const fonts = [
'Banner3',
'Larry 3D 2',
'Pebbles',
'JS Bracket Letters',
'Stop',
'Sub-Zero',
const express = require('express');
const bodyParser = require('body-parser');
require('dotenv').config();
const app = express();
app.use(bodyParser.urlencoded({ extended: false }));
app.use(bodyParser.json());
const knex = require('./db/knex');
exports.seed = function(knex, Promise) {
return knex('balloon').del()
.then(function () {
const balloons = [{
shape: 'circle',
volume: 123.2312,
color: 'red',
size: 'S'
}, {
shape: 'heart',