Skip to content

Instantly share code, notes, and snippets.

View httpJunkie's full-sized avatar
🏠
Working from home

Eric Bishard httpJunkie

🏠
Working from home
View GitHub Profile
<!DOCTYPE html>
<html>
<head>
<script type="text/javascript">
function write (message) {
document.getElementById('message').innerHTML += message + '<br/>';
}
function calculateCircumference(diameter){
@httpJunkie
httpJunkie / IMessageBoardRepository
Last active August 29, 2015 14:16
Update Topic in Web API with Repository
bool EditTopic(int id, Search newSearch);
@httpJunkie
httpJunkie / FavoritesController.cs
Last active August 29, 2015 14:16
CRUD for Favorites
namespace MyProject.Controllers.api
{
public class FavoritesController : ApiController
{
private IFavoritesRepository _favRepo;
public FavoritesController(IFavoritesRepository favRepo)
{
_favRepo = favRepo;
}
@httpJunkie
httpJunkie / filterByteFormat.js
Created November 30, 2015 04:00
Angular filter for formatting bytes
app.filter('bytes', function(){
return function(bytes, precision){
if (typeof bytes !== 'number') {
bytes = parseFloat(bytes);
}
if (bytes === 0) {
return '0 B';
} else if (isNaN(bytes) || !isFinite(bytes)) {
return '-';
@httpJunkie
httpJunkie / FlexboxLayout.md
Last active February 1, 2016 03:04
Emmet Snippets for Flexbox layout

Flexbox Layout Snippets for Emmet (docs.emmet.io)

FlexBox 50/50 columns with rows

div[layout="row"]>div[flex="50"]*2>div[layout="column"]>div[layout="row"]>div[flex="50"]*2

@httpJunkie
httpJunkie / arrayFilter.js
Created May 28, 2016 00:17
Aurelia ValueConverter - Array Filter by Text Input
export class ArrayFilterValueConverter {
toView(array, value) {
var regex = new RegExp(value, 'gi');
var matcher = (item) =>
item.utilityName.match(regex);
return array.filter(
matcher
);
}
}
@httpJunkie
httpJunkie / genericFilter.js
Last active September 8, 2016 06:50
Aurelia ValueConverter - Array Filter by Text Input
//aurelia ValueConverter
export class GenericFilterValueConverter {
toView(array, value, cols, showResults=false) {
if (!value) { return showResults ? array : []; };
var arrayOut = array.filter(
function(arrayIn) {
for (var col in arrayIn) {
if (arrayIn.hasOwnProperty(col)) {
if (cols.indexOf(col) != -1 && arrayIn[col].toLowerCase()
@httpJunkie
httpJunkie / Fibonacci Generator
Last active February 26, 2017 09:01
Fibbonacci Generator
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace FibonacciGenerator
{
internal class Program
{
@httpJunkie
httpJunkie / index.html
Created March 25, 2018 09:04
JS Bin play-with-svg // source http://jsbin.com/veyesob
<!DOCTYPE html>
<html>
<head>
<meta name="description" content="play-with-svg">
<meta charset="utf-8">
<meta name="viewport" content="width=device-width">
<title>JS Bin</title>
</head>
<style>
#one { fill: #444; }
import React, { Component } from 'react';
class ComponentName extends Component {
render() {
return ("");
}
}
export default ComponentName