Go's "multiple return values" feature, can be used for several purposes. Among them for failure reporting to the function caller. Go has two conventions for failure reporting, but currently, no clear convention for which to use when. I've encountered different programmers that prefer different choices in different cases. In this article, we will discuss the two, and try to make the process of choosing our next function signature more conscious.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using UnityEngine; | |
using Object = UnityEngine.Object; | |
namespace Utils | |
{ | |
public static class DrowsyLogger | |
{ | |
public static string Color(this string myStr, string color) | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Show hidden characters
{ | |
// This file is required for VSCode to understand webpack aliases | |
"module": "es6", | |
"moduleResolution": "node", | |
"compilerOptions": { | |
"resolveJsonModule": true, | |
"jsx": "preserve", | |
"module": "commonjs", | |
"target": "es5", | |
"sourceMap": true, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Shader "Custom/VertexColor" { | |
SubShader { | |
Tags { "RenderType"="Opaque" } | |
LOD 200 | |
CGPROGRAM | |
#pragma surface surf Lambert vertex:vert | |
#pragma target 3.0 | |
struct Input { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
String.prototype.parseTransform = function() { | |
var prop = ['translate', 'matrix', 'rotate', 'skewX', 'skewY', 'scale']; | |
var val = this.match(/(translate|matrix|rotate|skewX|skewY|scale)\(.*?\)/g); | |
var obj = {}; | |
if (val) { | |
for (var i = 0, length = val.length; i < length; i++) { | |
var item = val[i]; | |
var index = item.indexOf('('); | |
var v = item.substring(index + 1, item.length - 1).split(/\,|\s/); | |
var n = item.substring(0, index); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* Created by C.J. Kimberlin | |
* | |
* The MIT License (MIT) | |
* | |
* Copyright (c) 2019 | |
* | |
* Permission is hereby granted, free of charge, to any person obtaining a copy | |
* of this software and associated documentation files (the "Software"), to deal | |
* in the Software without restriction, including without limitation the rights |
Please petition Github to support HTTPS on github pages: https://github.com/contact
Here's what I wrote:
Obviously, a lot of people want HTTPS for github pages:
Until recently, that would be difficult to implement but, as it turns out, the implementation is pretty much complete:
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Hello, and welcome to makefile basics. | |
# | |
# You will learn why `make` is so great, and why, despite its "weird" syntax, | |
# it is actually a highly expressive, efficient, and powerful way to build | |
# programs. | |
# | |
# Once you're done here, go to | |
# http://www.gnu.org/software/make/manual/make.html | |
# to learn SOOOO much more. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Example: | |
// | |
// currentPos = ExpEase.Out(currentPos, targetPos, -4.0); | |
// | |
// or | |
// | |
// ExpEase.Out2(currentPos, targetPos, -4.0); // This modifies currentPos. | |
// | |
using UnityEngine; |