Skip to content

Instantly share code, notes, and snippets.

View nealalan's full-sized avatar

nealalan nealalan

View GitHub Profile
@nealalan
nealalan / keybase.io
Created November 29, 2017 03:46
Keybase
### Keybase proof
I hereby claim:
* I am nealalan on github.
* I am nealalan (https://keybase.io/nealalan) on keybase.
* I have a public key whose fingerprint is 0FCD DA82 34C1 BB84 EAA8 5C9C 46A1 0498 3B7C E79A
To claim this, I am signing this object:
@nealalan
nealalan / 20180830_174423-IMG_1126-4032x3024.JPG
Last active December 29, 2018 06:00
Flower closeup w/ iPhone X 2018-08-30, Denver, CO
20180830_174423-IMG_1126-4032x3024.JPG
@nealalan
nealalan / 20180831_182138-P1010229-4592x3448.JPG
Last active December 29, 2018 20:41
Nebraska Clouds taken 2018-08-31
20180831_182138-P1010229-4592x3448.JPG
@nealalan
nealalan / better-cli-prompt.md
Last active June 10, 2020 05:06
Make the command line better!!!

This is the prompt I am currently using. (Add to ~/.bashrc file.)

#######################################################################################################################
# BEAUTIFY THE COMMAND PROMPT WITH GIT
#######################################################################################################################
# get current branch in git repo
function parse_git_branch() {
 BRANCH=`git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/\1/'`
@nealalan
nealalan / photos.md
Last active November 7, 2020 03:12
Processing photos

By: Neal Dreher 2019-07-02

Processing Photos: Phone -> Library

Each time I pull photos from my phone (or camera memory card), I go through a process to pull, transform and store photos, followed by sorting, deleting and importing photos into old Google Picasa 3.9. The last version was released in Oct 2015. With 81,000 photos in Picasa, I fear the day I can no longer find a machine that I can run Picasa on.

Slowly I have been thinking about how I will sort my pictures and store them online. I don't really desire to store all in Google Photos, but it maybe the best free option. Right now, Google Photos doesn't have the options built out that Picasa does.

For example:

  • Selecting an area and tagging a face manually is possible in Picasa, not in photos.
  • Editing a location on a map is only possible in Picasa. You can use exiftool, to manually add GPS coords.
@nealalan
nealalan / json.md
Created August 5, 2019 23:25
JSON: JavaScript Object Notation Example

JSON: JavaScript Object Notation

  • JSON.stringify and JSON.parse
let string = JSON.stringify({squirrel: false,
                             events: ["weekend"]});
console.log(string);
// → {"squirrel":false,"events":["weekend"]}
console.log(JSON.parse(string).events);
@nealalan
nealalan / jsmath.md
Created August 5, 2019 23:29
JavaScript Match Function

MATH FUNCTION

  • Math.max (maximum)
  • Math.min (minimum)
  • Math.sqrt (square root)
  • Math.PI
  • Math.random (decimal)
  • Math.floor (rounds down to the nearest whole number)
console.log(Math.floor(Math.random() * 10));
// → 2
@nealalan
nealalan / jscorrelation.md
Created August 5, 2019 23:29
JavaScript Computing Correlation
  • function that computes the ϕ coefficient from such an array:
function phi(table) {
  return (table[3] * table[0] - table[2] * table[1]) /
    Math.sqrt((table[2] + table[3]) *
              (table[0] + table[1]) *
              (table[1] + table[3]) *
              (table[0] + table[2]));
}
@nealalan
nealalan / jsarrays.md
Last active August 5, 2019 23:34
JavaScript Notes on Arrays
@nealalan
nealalan / js-transpiling.md
Created August 6, 2019 00:05
JavaScript Transpiling

TRANSPILING

  • use a tool that converts your newer code into older code equivalent
  • ES6 adds a feature called "default parameter values." Transpiling will modify/add the code to work with ES5
  • Example:
// IN ES6, USE A DEFAULT VALUE
function foo(a = 2) {
	console.log( a );
}
// PRE ES6 EXPLICITLY CHECK FOR A DEFAULT VALUE AND DEFINE IT