Skip to content

Instantly share code, notes, and snippets.

View loganhenson's full-sized avatar

Logan Henson loganhenson

View GitHub Profile
@loganhenson
loganhenson / elm.js
Created September 20, 2016 21:38
Laravel Elixir Elm Extension
// for use with php elm gist: https://gist.github.com/loganhenson/90bb7d0c5207c4b549561ba6f30045a3
elixir.extend('elm', function(dir) {
var elmPath = elixir.config.assetsPath + '/elm/' + dir;
return new elixir.Task('elm', function() {
var command = 'elm make main.elm --output ../../../../' + elixir.config.publicPath + '/js/' + dir + '.js';
return gulp.src('').pipe(shell('cd ' + elmPath + ';' + command));
}).watch(elmPath + '/main.elm');
@loganhenson
loganhenson / elm.php
Last active September 20, 2016 21:38
<?php
// for use with laravel elixir elm gist: https://gist.github.com/loganhenson/5594e1a6259e830aa42479550b130e3e
function elm($app_name, $flags = [])
{
ob_start(); ?>
<div id="<?= $app_name ?>"></div>
@loganhenson
loganhenson / readme.md
Last active November 10, 2016 18:05
Elm - the why guide

Elm - the why guide

Why should I waste spend my time learning yet another javascript framework/language/thing?

First I want to set the tone of this post. We are taking an objective look at the javascript landscape and taking a bet on a tool.

Stage

  • we want correct software
  • with the least amount of time invested
  • we have more than 1 person working on it
/*import * as React from "react";
import * as ReactDOM from 'react-dom';
import { Provider } from 'react-redux'
import { Store, createStore } from 'redux';
import App from './containers/App';
import reducer from './data/reducer';
import { Model, initialState } from './data/model';
const store: Store<Model> = createStore(reducer, initialState);

MySql distance features you should know about!

There are many categories of apps out there that in some way/shape/form need to be able to find the simple distance between point A and point B.

A few examples might be:

  • A running or biking distance tracker will probably need to find the distance between point A and point B. Then point B and point C. Then point C and point D. (This would be a "linestring", but it still comes down to the simple problem of distance on the earth).
  • A restaurant delivery service might need to be able to see if you are within their maximum delivery distance.
@loganhenson
loganhenson / php-tighten-linting.md
Last active November 30, 2018 20:36
phpcs and tlint SUPER basic setup instructions

SUPER simple intro to a new dev for the steps to take to get PHPCS+Tlint set up in PHPstorm, and also the steps we would recommend Sublime use

Setting up linters for Tighten:

install phpcs and tlint

composer global require "squizlabs/php_codesniffer=*"
composer global require tightenco/tlint
console.clear();
const weight = 163; // lbs
const height = 182; // cm
const age = 27;
// Basal metabolic rate (calories you would use just sleeping all day)
const bmr = Math.floor(66 + (13.7 * (0.453592 * weight)) + (5 * height) - (6.8 * age));
// Total daily energy expenditure (includes a multiplier for a sedentary remote dev XD)
console.clear();
const weight = 163; // lbs
const height = 182; // cm
const age = 27;
// Basal metabolic rate (calories you would use just sleeping all day)
const bmr = Math.floor(66 + (13.7 * (0.453592 * weight)) + (5 * height) - (6.8 * age));
// Total daily energy expenditure (includes a multiplier for a sedentary remote dev XD)
import { listenAndServe } from 'https://deno.land/std/http/mod.ts'
import { readFileStr } from 'https://deno.land/std/fs/mod.ts'
import { match } from 'https://cdn.pika.dev/path-to-regexp@^6.1.0'
const render = async ({ page, state }) => {
return `
<!doctype html>
<html lang=en>
<head>
<meta charset=utf-8>