Skip to content

Instantly share code, notes, and snippets.

@AshCoolman
AshCoolman / is angular-new-router ready.md
Created January 15, 2016 16:17
is angular-new-router ready

Is angular-new-router ready?

Use in production?

  • Now: no
  • 3 months: probably not
  • 6 months: probably

Will it be in Beta?:

@AshCoolman
AshCoolman / ui-browser.applescript
Created May 25, 2016 18:00
UI Browser.applescript
-- http://hints.macworld.com/article.php?story=20111208191312748
set appname to "1Password" -------------------------- Set this to the App you want to look at
set winstuff to "defaultval"
set menustuff to "defaultval"
tell application appname
activate
end tell
@AshCoolman
AshCoolman / gist:b702beb860337098ee9161b88e7e81f7
Last active October 14, 2016 10:17
Get your employee id_rsa.pub via slack
/remind @<YOUR EMPLOYEE> at 9:30am Please run this in ur terminal - it will send me your public ssh key `curl -X POST --data-urlencode "payload={\"channel\": \"@<ENTER YOUR USER NAME>\", \"username\": \"$(whoami)\", \"text\": \"$(cat ~/.ssh/id_rsa.pub)\", \"icon_emoji\": \":ghost:\"}" https://hooks.slack.com/services/<YOUR SLACK WEB HOOK>`
@AshCoolman
AshCoolman / portable-node.md
Created February 8, 2017 05:10 — forked from domenic/portable-node.md
Tips for Writing Portable Node.js Code

Node.js core does its best to treat every platform equally. Even if most Node developers use OS X day to day, some use Windows, and most everyone deploys to Linux or Solaris. So it's important to keep your code portable between platforms, whether you're writing a library or an application.

Predictably, most cross-platform issues come from Windows. Things just work differently there! But if you're careful, and follow some simple best practices, your code can run just as well on Windows systems.

Paths and URLs

On Windows, paths are constructed with backslashes instead of forward slashes. So if you do your directory manipulation

@AshCoolman
AshCoolman / main.go
Last active March 7, 2018 13:21
auth0 in go HelloWorld
package main
import (
"encoding/base64"
"encoding/json"
"fmt"
"net/http"
"os"
"github.com/auth0-community/auth0"
@AshCoolman
AshCoolman / js
Created November 9, 2017 15:40
User agent strip rip.js
// ripped from https://github.com/ferd/useragent/blob/master/test/useragent_tests.erl
const userAgents = [
[
// "Internet Explorer 6">>, ie, web, microsoft, trident, [
'Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.0; T312461)',
'Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; .NET CLR 1.1.4322; XMPP Tiscali Communicator v.10.0.2; .NET CLR 2.0.50727)',
'Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.2; SV1; .NET CLR 1.1.4322; .NET CLR 2.0.50727)',
],
[
// "Internet Explorer 7">>, ie, web, microsoft, trident, [
@AshCoolman
AshCoolman / naming-things-is-hard.md
Last active October 21, 2020 05:44
Naming things is hard

Always beware that in English, the use of a past participle as an adjective is ambiguous between transitive and intransitive verbs (and perhaps between active and passive voice). isRecovered might mean that the object has been recovered by something else, or it might mean that the object has recovered. If your object represents a patient at a hospital, does "isRecovered" mean that the patient is fit and well, or that someone has fetched the patient back from the X-ray department? wasRecovered might therefore be better for the latter.

https://stackoverflow.com/questions/3669433/do-you-use-tense-when-naming-methods-of-boolean-return-type

Like this but with attributes/adjectives https://segment.com/academy/collecting-data/naming-conventions-for-clean-data/

If the property/method is a boolean, use isVal() or hasVal().

@AshCoolman
AshCoolman / lerna-test-coverage.sh
Created January 17, 2018 16:52
Lerna aggregate package coverage
# Aggregate lcov coverage data from all packages
lerna exec -- "yarn test --coverage"
yarn test --coverage
# yarn add lcov-result-merger -D
./node_modules/.bin/lcov-result-merger lcov.info ./all-coverage
./node_modules/.bin/lcov-result-merger '**/lcov.info' ./all-coverage
# brew install lcov
@AshCoolman
AshCoolman / lerna-find-all-tests.sh
Created January 17, 2018 17:18
lerna find all tests
find . \
\( -name '*.spec.js' -o -name '*.spec.jsx' \) \
-and \
\( \
\( -not -path "*node_modules*" \) \
-and \
\( -not -path "*.dist*" \) \
\)
@AshCoolman
AshCoolman / gen-changelog.sh
Created January 17, 2018 17:22
Generate changelog
echo ""
echo "# Change log"
echo ""
git log `git describe --tags --abbrev=0`..HEAD --oneline --pretty=format:"* %s"
echo ""