Skip to content

Instantly share code, notes, and snippets.

View w3cj's full-sized avatar
🌱

CJ w3cj

🌱
View GitHub Profile
// O(n + n + n/2)
// O(2n + n/2)
// O(2.5n)
// O(n)
public boolean isPalindrome(String input) {
// replaceAll - n times
input = input.replaceAll("\\s","");
// replaceAll - n times
int n = input.length();
// run from the command line with:
// javac PalindromeTester.java && java PalindromeTester
public class PalindromeTester {
public boolean isPalindrome(String input) {
// your code here
return false;
}
@w3cj
w3cj / Car.java
Last active June 21, 2019 15:06
Live coded java examples
public class Car {
public int miles = 0;
public int miles() {
return 12;
}
public static void main(String[] args){
Car car = new Car();

DevOps


Objectives

  • Define and describe DevOps
  • Define and describe CI
  • Define and describe CD
  • List some common CI/CD tools
@w3cj
w3cj / tdd.md
Last active December 12, 2020 10:38

Test Driven Development


Objectives

  • Explain why you might want to Test
  • Install a test framework
  • Red-Green-Refactor
  • Write basic tests that check for equality
  • Practice pairing techniques
using System;
namespace Galvanize
{
abstract class Animal
{
public abstract string poop();
}
class Dog : Animal

Team Collaboration with Git



Setup

@w3cj
w3cj / merge.js
Last active March 26, 2021 16:02
function mergeSort(arr) {
//
// If your array has a length less than 2, congratulations! It's already sorted.
if(arr.length < 2) {
return arr;
}
// Otherwise, cut your array in half, and consider the two sub-arrays separately.
var firstLength = arr.length / 2;
var firstHalf = arr.slice(0, firstLength);
console.log('firstLength', firstLength);