Skip to content

Instantly share code, notes, and snippets.

Class Main {
public void bfs()
{
// BFS uses Queue data structure
Queue queue = new LinkedList();
queue.add(this.rootNode);
printNode(this.rootNode);
rootNode.visited = true;
while(!queue.isEmpty()) {
Node node = (Node)queue.remove();
# ---------------------------------------------------------------------------
#
# Description: This file holds all my BASH configurations and aliases
#
# Sections:
# 1. Environment Configuration
# 2. Make Terminal Better (remapping defaults and adding functionality)
# 3. File and Folder Management
# 4. Searching
# 5. Process Management
<!DOCTYPE html>
<html>
<head>
<meta name="description" content="[add your bin description]" />
<script src="http://code.jquery.com/jquery-1.11.0.min.js"></script>
<script src="http://d3js.org/d3.v3.min.js"></script>
<meta charset="utf-8">
<title>JS Bin</title>
</head>
<body>
@HipsterZipster
HipsterZipster / index.html
Last active December 31, 2015 02:20
RxJS Time Operator Comparison (sample, debounce, throttle, throttleFirst) // source http://jsbin.com/jepeji Also See: https://gist.github.com/anonymous/f59e6b709105a3401d80
<!DOCTYPE html>
<html>
<head>
<meta name="description" content="RxJS Throttle vs Sample">
<script src="https://cdnjs.cloudflare.com/ajax/libs/rxjs/2.5.3/rx.all.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/rxjs/2.5.3/rx.time.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/rxjs/2.5.3/rx.virtualtime.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/rxjs/2.5.3/rx.testing.js"></script>
<meta charset="utf-8">
@HipsterZipster
HipsterZipster / interviewitems.MD
Created May 4, 2016 21:37 — forked from KWMalik/interviewitems.MD
My answers to over 100 Google interview questions

##Google Interview Questions: Product Marketing Manager

  • Why do you want to join Google? -- Because I want to create tools for others to learn, for free. I didn't have a lot of money when growing up so I didn't get access to the same books, computers and resources that others had which caused money, I want to help ensure that others can learn on the same playing field regardless of their families wealth status or location.
  • What do you know about Google’s product and technology? -- A lot actually, I am a beta tester for numerous products, I use most of the Google tools such as: Search, Gmaill, Drive, Reader, Calendar, G+, YouTube, Web Master Tools, Keyword tools, Analytics etc.
  • If you are Product Manager for Google’s Adwords, how do you plan to market this?
  • What would you say during an AdWords or AdSense product seminar?
  • Who are Google’s competitors, and how does Google compete with them? -- Google competes on numerous fields: --- Search: Baidu, Bing, Duck Duck Go
@HipsterZipster
HipsterZipster / DebounceBuffer.java
Created June 9, 2016 05:08 — forked from benjchristensen/DebounceBuffer.java
DebounceBuffer: Use publish(), debounce() and buffer() together to capture bursts of events.
import java.util.List;
import java.util.concurrent.TimeUnit;
import rx.Observable;
import rx.Subscriber;
import rx.schedulers.Schedulers;
public class DebounceBuffer {
public static void main(String args[]) {
@HipsterZipster
HipsterZipster / app\actions\foo.ts
Created July 29, 2016 14:23 — forked from JamesHenry/app\actions\foo.ts
ngMetadata 2.x - with @ngrx/store on Angular 1
import { Injectable } from 'ng-metadata/core'
import { Action } from '@ngrx/store'
interface SomePayload {
baz: string
}
/**
* Instead of passing around action string constants and manually recreating
* action objects at the point of dispatch, we create services encapsulating
var DOMTokenListSupports = function(tokenList, token) {
if (!tokenList || !tokenList.supports) {
return;
}
try {
return tokenList.supports(token);
} catch (e) {
if (e instanceof TypeError) {
console.log("The DOMTokenList doesn't have a supported tokens list");
} else {
var DOMTokenListSupports = function(tokenList, token) {
if (!tokenList || !tokenList.supports) {
return;
}
try {
return tokenList.supports(token);
} catch (e) {
if (e instanceof TypeError) {
console.log("The DOMTokenList doesn't have a supported tokens list");
} else {
@HipsterZipster
HipsterZipster / np.sh
Created May 24, 2018 20:08 — forked from stevemao/np.sh
Publish node module
# npm publish with goodies
# prerequisites:
# `npm install -g trash conventional-recommended-bump conventional-changelog conventional-github-releaser conventional-commits-detector json`
# `np` with optional argument `patch`/`minor`/`major`/`<version>`
# defaults to conventional-recommended-bump
# and optional argument preset `angular`/ `jquery` ...
# defaults to conventional-commits-detector
np() {
travis status --no-interactive &&
trash node_modules &>/dev/null;