Skip to content

Instantly share code, notes, and snippets.

View itsthatguy's full-sized avatar
✌️
Love.

Kevin Altman itsthatguy

✌️
Love.
View GitHub Profile
{
"labels": [
"2022-05-02T21:00:17.000Z",
"2022-05-03T21:19:29.000Z",
"2022-05-04T22:12:47.000Z",
"2022-05-06T01:56:56.000Z",
"2022-05-06T20:32:39.000Z",
"2022-05-09T20:08:01.000Z",
"2022-05-10T21:48:51.000Z",
"2022-05-11T22:44:55.000Z",
defmodule FS do
def files(dir) do
Path.wildcard(dir)
end
def file_names(dir) do
dir
|> files
|> Enum.map(fn name_with_extension ->
String.replace(name_with_extension, ~r/\.\w+$/, "")
###########################################
# General helpers
# - Get octal permissions of 'path(s)'
# alias octal="stat -c '%a %n' $*"
alias octal="stat -f '%A %a %N'"
# - ln command help
alias lnwtf="echo ln -s '[FROM (ie; \$PWD)] [TO (new location)]'"

Keybase proof

I hereby claim:

  • I am itsthatguy on github.
  • I am itg (https://keybase.io/itg) on keybase.
  • I have a public key ASBm9BLrtS5FjRi7dyvP6GaJ2oGuyibii493227e96uQ3Qo

To claim this, I am signing this object:

var userPreferencesDict = [
'favoriteFood',
'favoriteColor',
'favoriteNumber',
];
var userPreferences = [
'pizza',
'seafoam green',
'42'
@itsthatguy
itsthatguy / dictionaries.js
Last active September 21, 2017 22:07
Makes using arrays that you have zero control over easier to reference values.
var userPreferencesDict = [
'favoriteFood',
'favoriteColor',
'favoriteNumber',
];
var userPreferences = [
'pizza',
'seafoam green',
'42'
var nlp = require('compromise')
function parseCommand (input) {
var doc = nlp(input)
var cmd = doc.verbs().out('array');
var objects = doc.nouns().out('array');
console.log(cmd);
console.log(objects);
function git_dir_helper() {
current_dir=${PWD##*/}
if git rev-parse --git-dir > /dev/null 2>&1 && [ ! -d .git ]; then
git_dir_cdup=$(git rev-parse --show-cdup)
git_dir_path=$(git rev-parse --show-prefix)
git_dir_top="$(
cd $git_dir_cdup > /dev/null
echo ${PWD##*/}
)"
current_dir="$git_dir_top/${git_dir_path%/}"
function myPromise () {
return new Promise((resolve) => {
setTimeout(() => {
console.log('fourth a');
resolve('fourth b');
}, 200);
});
}
async function second () {
import React, {PureComponent} from 'react';
// I've setup webpack to use relative paths from the src/ directory
import Results from 'Results';
import SearchBar from 'SearchBar';
// What is a PureComponent?
class Layout extends PureComponent {
// constructor receives props
// should we explain props?