Skip to content

Instantly share code, notes, and snippets.

#!groovy
pipeline {
agent any
stages {
stage('Checkout') {
steps {
checkout scm
}
@bhuber2010
bhuber2010 / HashTable.js
Created April 20, 2016 19:41 — forked from alexhawkins/HashTable.js
Correct Implementation of a Hash Table in JavaScript
var HashTable = function() {
this._storage = [];
this._count = 0;
this._limit = 8;
}
HashTable.prototype.insert = function(key, value) {
//create an index for our storage location by passing it through our hashing function
var index = this.hashFunc(key, this._limit);
@bhuber2010
bhuber2010 / setup-es6-linting.md
Created February 12, 2016 19:40
Linting ES6+Babel+JSX in Atom

Setup ES6+Babel+JSX Linting with Atom

This sets up Atom to properly lint ES6+Babel+JSX using Airbnb's .eslintrc as a starting point.

Steps

  1. Download Atom and get these two packages: Linter and [Linter-ESLint)(https://atom.io/packages/linter-eslint)
  2. Run npm install --save-dev eslint-config-airbnb babel-eslint eslint-plugin-react from your project root.
  3. Add "extends": "eslint-config-airbnb" to your .eslintrc
// Includes functions for exporting active sheet or all sheets as JSON object (also Python object syntax compatible).
// Tweak the makePrettyJSON_ function to customize what kind of JSON to export.
var FORMAT_ONELINE = 'One-line';
var FORMAT_MULTILINE = 'Multi-line';
var FORMAT_PRETTY = 'Pretty';
var LANGUAGE_JS = 'JavaScript';
var LANGUAGE_PYTHON = 'Python';
@bhuber2010
bhuber2010 / book.html
Created January 20, 2016 19:15 — forked from w3cj/book.html
AngularJS Overview
<div class="col-md-2 col-xs-4" style="padding:20px;">
<img ng-src="{{book.cover_url}}" class="img-responsive" alt="" />
</div>
<div class="col-md-10 col-xs-8">
<h3>{{book.title}}</h3>
<p><em>{{book.genre}}</em></p>
<p>
{{book.description}}
</p>
</div>
// Output:
//
// {
// "optimize" : { count: 1, people: ["Ila Huels"] },
// "web-enabled" : { count: 1, people: ["Ila Huels"] },
// "supply-chains" : { count: 1, people: ["Ila Huels"] },
// "brand" : { count: 2, people: ["Ila Huels", "Cristopher Feest"] },
// "sexy" : { count: 2, people: ["Ila Huels", "Cristopher Feest"] },
// "channels" : { count : 2, people : ["Ila Huels", "Cristopher Feest"] },
// "envisioneer" : { count: 1, people: ["Ila Huels"] },
@bhuber2010
bhuber2010 / restful_routes.md
Created December 11, 2015 18:24 — forked from alexpchin/restful_routes.md
7 Restful Routes
URL HTTP Verb Action
/photos/ GET index
/photos/new GET new
/photos POST create
/photos/:id GET show
/photos/:id/edit GET edit
/photos/:id PATCH/PUT update
/photos/:id DELETE destroy
var http = require('http');
var fs = require('fs');
var url = require('url');
var path = require('path');
var app = http.createServer(function(request, response) {
var parsedURL = url.parse(request.url, true);
console.log(parsedURL);
fs.readFile(path.join('.', parsedURL.pathname), 'utf8', function(err, contents) {
if (err) {