Skip to content

Instantly share code, notes, and snippets.

View rayie's full-sized avatar

Ray Ie rayie

View GitHub Profile
@rayie
rayie / bookprices.js
Created November 21, 2014 07:53
Assignment: Bookprices 1
var bookprices = {
// each book in the series costs $14 each, there are 7 books in the series
"HarryPotter" : {
price: 14, // the price of one book
books: 7 // the number of books in the series
},
"CaptainUnderpants": {
price: 5,
books: 12
},
/*
Assignment 2:
Use a while loop to print out how much each kid spent on books. Each kid buys only the number stated in the kid's record, not the number in the series.
Also show how much each kid has in his bank after spending the money on the books he bought.
Example:
Jason spent $28 on HarryPotter books. He has $72 left.
*/
var bookprices = {
// each book in the series costs $14 each, there are 7 books in the series
"HarryPotter" : {
price: 14, // the price of one book
books: 7 // the number of books in the series
},
"CaptainUnderpants": {
price: 5,
books: 12
},
@rayie
rayie / pokedex_array.js
Last active September 16, 2015 15:21
pokedex array
var pokedex = [
{
"name": "Bulbasaur",
"base": {
"Attack": 49,
"Defense": 49,
"HP": 45,
"Speed": 45
}
},
'use strict';
const Promise = require("bluebird");
const fs = require("fs");
const exec = require('child_process').exec;
const write = Promise.promisify(fs.writeFile);
const read = Promise.promisify(fs.readFile);
const rename = Promise.promisify(fs.rename);
const unlink = Promise.promisify(fs.unlink);
const storage = require('@google-cloud/storage')();
@rayie
rayie / tif_to_pdf
Created November 27, 2017 21:44
Sample cloud function to convert tif to pdf
'use strict';
const Promise = require("bluebird");
const fs = require("fs");
const exec = require('child_process').exec;
const write = Promise.promisify(fs.writeFile);
const read = Promise.promisify(fs.readFile);
const rename = Promise.promisify(fs.rename);
const unlink = Promise.promisify(fs.unlink);
const storage = require('@google-cloud/storage')();
<div style="width:80px;height:20px;padding:10px;margin:10px;background-color:#000000">#000000</div>
<div style="width:80px;height:20px;padding:10px;margin:10px;background-color: #434343">#434343</div>
<div style="width:80px;height:20px;padding:10px;margin:10px;background-color: #666666">#666666</div>
<div style="width:80px;height:20px;padding:10px;margin:10px;background-color: #999999">#999999</div>
<div style="width:80px;height:20px;padding:10px;margin:10px;background-color: #cccccc">#cccccc</div>
<div style="width:80px;height:20px;padding:10px;margin:10px;background-color: #efefef">#efefef</div>
<div style="width:80px;height:20px;padding:10px;margin:10px;background-color: #f3f3f3">#f3f3f3</div>
<div style="width:80px;height:20px;padding:10px;margin:10px;background-color: #ffffff">#ffffff</div>
<div style="width:80px;height:20px;padding:10px;margin:10px;background-color: #fb4c2f">#fb4c2f</div>
<div style="width:80px;height:20px;padding:10px;margin:10px;background-color: #ffad47">#ffad47</div>

This is a running list of things I'm keeping that might help you in your Comp Sci studies, or freelance jobs once you start actually working on projects. Getting a working knowledge of these things sooner should give you a head start.

Concepts to Learn (not in any particular sequence)

  • JSON https://www.json.org/json-en.html
  • Basic SQL
  • NoSQL MongoDB https://www.mongodb.com/
  • Learn basic GIT concepts - for working on coding projects with team mates
  • Your macbook's native shell (using iTerm or the native Mac terminal app)
  • Basic understanding of linux shell operations, ssh sessions, as you you will likely need to work on remote servers
  • When you're watching/reading a tutorial, and it involves one or more framework (or libraries), remember there are likely to be many other frameworks you can use in place of the ones the tutorial involves. Keeping it clear in your head to know the difference between the native thing you're learning about from the framework is important.
(function() {
var el = document.createElement("div"),
b = document.getElementsByTagName("body")[0],
otherlib = !1,
msg = "";
el.style.position = "fixed", el.style.height = "32px", el.style.width = "220px", el.style.marginLeft = "-110px", el.style.top = "0", el.style.left = "50%", el.style.padding = "5px 10px", el.style.zIndex = 1001, el.style.fontSize = "12px", el.style.color = "#222", el.style.backgroundColor = "#f99";
function showMsg() {
var txt = document.createTextNode(msg);
el.appendChild(txt), b.appendChild(el), window.setTimeout(function() {

Create a Sample Barebones web app that enables only this:

  1. Someone opens a browser tab with a URL to your app: http://[yourapp.com]
  2. If the user is not logged in - provide UI components to let them a) log-in or to b) create an account
  3. If user is logged in - provide UI components to add a note and to view notes created by that user in the past. Each note is a just some plain text with timestamp.