Skip to content

Instantly share code, notes, and snippets.

@cch5ng
cch5ng / rmElementFromArrayObjects.js
Created June 23, 2015 21:55
remove element from array of js objects
//removes element based on the id of matching object in an array
//@param ar - array of objects
//@param id - unique id to check for each array element
//if an element's id matches the given id, then remove that
//element from the array
//case1 - the array only contains that element
//case1 - element at idx = 0 (array length > 1)
//case2 - element at idx = n - 1 (array length = n; n > 1)
//case3 - element at idx = m (array length = n; 0 < m < n -1)
@cch5ng
cch5ng / angular_learn_resources.txt
Last active August 29, 2015 14:20
Angular.js Resources
//Angular.js learning resources
High level instructional videos with exercises (good start)
https://www.codeschool.com/courses/shaping-up-with-angular-js
Lessons with sample code/github source
https://docs.angularjs.org/tutorial
*I ran into some time consuming issues trying to get their tests to run successfully in the 2nd half of the tutorials
Learn and Understand AngularJS - The First 50 Minutes (Tony Alicea)
@cch5ng
cch5ng / css_layout1.html
Created March 4, 2015 02:19
Practice CSS for layout
<!--
two implementations of image: http://blog.danielna.com/assets/img/2013-07-01_fe1.jpg
1 using pixel dimensions: http://jsfiddle.net/h82g7f39/1/
2 using percentages, below
origin: http://blog.danielna.com/getting-a-job-as-a-front-end-web-developer.html
-->
<html>
<head>
@cch5ng
cch5ng / tech_interview_prob.js
Last active November 28, 2016 01:08
(Tech interview practice) function that takes two sorted lists of numbers and merges them into a single sorted list.
// function that takes two sorted lists of numbers and merges them into a single sorted list.
ar1 = [1, 4, 5, 7, 10];
ar2 = [0, 3, 6, 11, 14];
function mergeSort(ar1, ar2) {
var sortedAr = [];
while (ar1.length > 0 && ar2.length > 0) {
if (ar1[0] < ar2[0]) {
sortedAr.push(ar1.splice(0, 1)[0]);
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>JS Bin</title>
</head>
<body>
<script id="jsbin-javascript">
var test1 = 'ana';
@cch5ng
cch5ng / python_interview_question.py
Last active August 29, 2015 14:02
python interview test question (I was annoyed w/ self b/c I psyched self out during interview and didn't pass this test but wanted to solve it anyways)
#!/usr/bin/env python
# directions: parse a given string
# check whether the string contents contain words found in a given dictionary
# print out the words with a space delimiter
long_str = "monkeyheartpear"
dict = {1: "monkey", 2: "heart", 3: "pear"}
result = ""
word = ""
@cch5ng
cch5ng / home.py
Last active August 29, 2015 14:01
Working /pages/home.py (only updated line 28 and function and line 58 for testing)
#!/usr/bin/env python
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
import re
from selenium.webdriver.common.by import By
from selenium.webdriver.support.ui import WebDriverWait
@cch5ng
cch5ng / test_about_page.py
Last active August 29, 2015 14:01
Working /tests/test_about_page.py
#!/usr/bin/env python
#!/usr/bin/env python
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
from pages.home import Home
from pages.start_page import StartPage
from unittestzero import Assert
@cch5ng
cch5ng / about_page.py
Last active August 29, 2015 14:01
Working /pages/about_page.py
#!/usr/bin/env python
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
from selenium.webdriver.common.by import By
from selenium.webdriver.common.action_chains import ActionChains
from selenium.webdriver.support.ui import WebDriverWait