Skip to content

Instantly share code, notes, and snippets.

View davidpaulhunt's full-sized avatar
🏖️
#RemoteLife

David Hunt davidpaulhunt

🏖️
#RemoteLife
View GitHub Profile
@davidpaulhunt
davidpaulhunt / interface-ex.go
Last active September 10, 2017 15:24
Basic interface example in Go
package main
import (
"fmt"
"strings"
)
func write(msg string) {
fmt.Println(msg)
}
@davidpaulhunt
davidpaulhunt / curry.go
Created September 10, 2017 07:06
Basic currying in Go
// Go Playground: https://play.golang.org/p/6C9Wj8uqmc
package main
import "fmt"
func increment(x int) int {
return x + 1
}
func decrement(x int) int {
@davidpaulhunt
davidpaulhunt / glossary.md
Last active January 31, 2017 17:29
The Developer's Glossary - a resource for beginners

The Web Developer's Glossary

a

asynchronous

b

back-end

@davidpaulhunt
davidpaulhunt / exploring_lodash_1.md
Last active November 21, 2016 22:07
Exploring Lodash #1

Introduction and _.isArray

If you're a JavaScript developer in 2016, you're likely at least aware of Lodash, a self-described

modern JavaScript utility library delivering modularity, performance, & extras.

Personally, it's a favorite of mine. From _.compact all the way to _.toPath, there's nothing like benefiting from the solution to a problem others have already solved; plus, I find its API to be enjoyable and intuitive.

Forgetting to be Thoughtful

@davidpaulhunt
davidpaulhunt / excon_openssl.md
Last active November 6, 2016 09:20
Unable to verify certificate fix re: excon, openssl, and fog

Ran into the excon/openssl error certificate verify failed (OpenSSL::SSL::SSLError) Unable to verify certificate.

After reading through a few posts, trying different solutions, here are the steps that resolved the issue with regards to my particular needs. Final main source at the bottom.

brew doctor
brew update openssl

rvm get stable
rvm install ruby-2.1.9 --with-openssl-dir=`brew --prefix openssl`
/*
* Initially, test runs were handled via a single executable
* causing many large objects and references from within setup
* code, and perhaps vows, to hang around despite garbage collection.
*/
(function runFile(i) {
if (i > filenames.length) {
return exit();
}
const filename = filenames[i];

puppet-master.js

function exit() {
  // check for and do something with instances of Error
  // passed as arguments i/e if arguments.length > 1 ...
  //  Array.from(arguments).map...
  if (process.env.CHILD_PID) {
    childProcess.execFile(`kill -9 ${process.env.CHILD_PID}`);
  }
  printResults();
import request from 'superagent';
export const VALIDATING_TOKEN = 'VALIDATING_TOKEN';
function requestTokenValidation() {
return { type: VALIDATING_TOKEN };
}
export const TOKEN_VALIDATION_RECEIVED = 'TOKEN_VALIDATION_RECEIVED';
function receiveTokenValidation(response) {
return { type: TOKEN_VALIDATION_RECEIVED, response };

Passwordless Authentication with Rails 5

Declaration

// old
const helloWorld = React.createClass({
  render() {},
});

// new
class HelloWorld extends React.Component {
  render() {}