Skip to content

Instantly share code, notes, and snippets.

@rszewczyk
rszewczyk / index.html
Last active August 29, 2015 14:19
VDOM Example
<!doctype html>
<html>
<head>
<script src="http://fb.me/react-0.13.1.js"></script>
</head>
<body>
<div id="main"></div>
<script src="./bundle.js"></script>
</body>
</html>
@rszewczyk
rszewczyk / styled.js
Last active October 1, 2016 20:10
Experimenting with css in js
import React, { PropTypes } from 'react'
import CSSPropertyOperations from 'react/lib/CSSPropertyOperations'
import cn from 'classnames'
let classId = 0
const domStyleNode = document.createElement('style')
document.head.appendChild(domStyleNode)
const styleCache = {}
@rszewczyk
rszewczyk / README.md
Last active October 7, 2016 06:48
Elasticsearch Simple Test

copy-pastable example that uses docker-machine to provision a docker host and run an elasticsearch cluster with a simple test app that prints the number of cluster nodes. Assumes a correct ~/.aws/credentials file and a security group with open inbound ports 22, 2375 and (optionally) 9300 defined for the VPC you're deploying to.

docker-machine create -d amazonec2 --amazonec2-instance-type t2.medium --amazonec2-vpc-id vpc-**** --amazonec2-security-group estesting estest01
eval $(docker-machine env estest01)
docker network create estesting

# dedicated master
docker run -d --name es01 --network estesting elasticsearch -Dnode.data=false
@rszewczyk
rszewczyk / .emacs
Last active February 16, 2017 21:31
UMBC CMSC104 Resources
(global-font-lock-mode 0)
(set-face-foreground 'minibuffer-prompt "white")
(setq c-default-style "ellemtel")
@rszewczyk
rszewczyk / cw05.c
Last active February 28, 2017 21:24
CMSC 104 - Classwork 5
/*
* PART 1: Replace this section with a properly formatted header
*/
#include <stdio.h>
int main()
{
/*******************************************************
*
* PART 2:
@rszewczyk
rszewczyk / cw06part1.c
Last active March 7, 2017 22:55
UMBC, CMCS 104 - Classwork 6: Arithmetic in C
#include <stdio.h>
int main()
{
/*******************************************************
*
* PART 1: Review of the assigment operator
*
* The assigment operator, symbolized with '=' stores
* a value in a variable. The statement `int my_value = 3`
@rszewczyk
rszewczyk / instructions.md
Last active April 11, 2017 18:23
UMBC CMSC 104 - Homework #3

Homework 3

Part 1

Write a program that prompts the user to enter 2 numbers. If both numbers are even, the program will print the text Both numbers are even. If only the first number is even, the program will print the text The first number is even. If only the second number is even, the program will print the text The second number is even. If neither number is even, the program will print the text Both numbers are odd.

Save your program in a file called hw03part1.c.

@rszewczyk
rszewczyk / cw08.c
Last active April 11, 2017 18:42
UMBC CMSC104 Classwork 8
#include <stdio.h>
/*
* Basics of a while loop
*/
int main() {
/*
* Part 1 Instructions
*
@rszewczyk
rszewczyk / project2.md
Last active November 9, 2017 21:12
UMBC CMSC104 Project 2

Project 2

Due Tuesday 11/28/2017 at 5:30pm EST

Instructions

Write a program that allows two players to play a guessing game. The program works as follows:

  1. First, player 1 enters the secret number. The program should check that the number is not less than 0 and not greater than 99, prompting the user to re-enter the number if needed.
  2. Player 1 is then prompted for, and enters the number of guesses that player 2 gets.
  3. Player 2 begins entering guesses. The prompt for a guess should inform the user how many guesses they have remaining. After they make an incorrect guess, the program should tell them if their guess is greater than or less than the secret number and prompt for another guess (with an updated count of guesses remaining).
  4. If player 2 guesses the number before running out of guesses they win. The program should inform player 2 whether they won or lost.
@rszewczyk
rszewczyk / assignment.markdown
Last active October 17, 2017 20:40
UMBC CMSC Fall 2017 - 10/5/2017

Assignment - Class #10 10/5/2017

In this assigment you will learn the ins and outs of printing certain types of output to the screen and getting input from the user.

As part of this assigment you will create a program in a file called inout.c. When you complete the assigment you will submit inout.c by uploading it to Slack. If you do not finish today, you have until the end of class (6:45pm) on Tuesday, 10/10/2017 to turn it in. Note this doesn't necessarily mean you will have time to work on it in class on 10/10. If don't finish today, you should try and finish it before Tuesday.