Skip to content

Instantly share code, notes, and snippets.

View mchelen's full-sized avatar

Mike Chelen (he/him) mchelen

View GitHub Profile
{
"series_id":"ELEC.PLANT.GEN.2-ALL-ALL.M",
"name":"Net generation : Bankhead Dam (2) : all fuels : all primemovers : monthly",
"units":"megawatthours",
"f":"M",
"description":"Summation of all fuels used for electricity generation; ",
"copyright":"None",
"source":"EIA, U.S. Energy Information Administration",
"iso3166":"USA-AL",
"lat":"33.458665",
const composeEnhancers = (window as any).__REDUX_DEVTOOLS_EXTENSION_COMPOSE__ || compose;
export const store = createStore<StoreState, FilterAction, any, any>(
rootReducer,
{
query: initialQueryState,
ui: {
hello: "world"
},
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width">
<title>JS Bin</title>
</head>
<body>
<script id="jsbin-javascript">
@mchelen
mchelen / index.js
Created August 15, 2018 20:32
MDN Prototype Inheritance Javascript Example
var input = document.querySelector('input');
var btn = document.querySelector('button');
var para = document.querySelector('p');
btn.onclick = function() {
var code = input.value;
para.textContent = eval(code);
}
function Person(first, last, age, gender, interests) {
this.name = {
first,
import { Get, Controller } from '@nestjs/common';
import elasticsearch = require('elasticsearch');
@Controller('search')
export class SearchController {
@Get()
async doSearch(): Promise<any> {
➜ npm-script cat package.json
{
"name": "npm-script",
"version": "1.0.0",
"description": "",
"main": "index.js",
"scripts": {
"echo": "source .env && echo $FOO"
},
"author": "",
<my-directive foo="bar"></my-directive>
@mchelen
mchelen / index.js
Last active December 5, 2017 04:12
accessing an object property in node async
const async = require('async');
function myObject (text) {
this.text = text;
}
myObject.prototype.run = function (callback) {
async.parallel(
[
this.doing,
@mchelen
mchelen / index.js
Last active December 5, 2017 03:27
how to access a parent property from inside IIFE
// example of using .call with an IIFE
function myObject (text) {
this.text = text;
}
myObject.prototype.print = function () {
console.log(this.text); // works
$scope.products = [
'product1' = {
title = 'Product 1',
links = 'linksA',
}
'product2' = {
title = 'Product 2',
links = 'linksB',
}
'product3' = {