GithubHelp home page GithubHelp logo

drn / dots Goto Github PK

View Code? Open in Web Editor NEW
22.0 22.0 4.0 9.68 MB

:new_moon: Obsessively curated dotfiles.

License: MIT License

Ruby 2.75% Shell 25.52% Lua 14.72% Go 35.40% Vim Snippet 1.18% Vim Script 20.44%

dots's Introduction

Hello, I'm Darren 👋

I'm the CTO & Co-founder @ Thanx. If you're looking to join a great engineering team, check out our careers page or feel free to send me a note at darren-at-thanx-dot-com.

dots's People

Contributors

dependabot-preview[bot] avatar drn avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

dots's Issues

Manage ~/.bundle/config in dots

brianmario/mysql2#1005 (comment)

Ensure bundle config --global build.mysql2 --with-opt-dir="$(brew --prefix openssl)" is configured

Current ~/.bundle/config:

---
BUNDLE_DISABLE_LOCAL_BRANCH_CHECK: "true"
BUNDLE_GEM__TEST: "false"
BUNDLE_GEM__MIT: "true"
BUNDLE_GEM__COC: "true"
BUNDLE_DELETE: "thanx-style"
BUNDLE_BUILD__NOKOGIRI: "--use-system-libraries --with-xml2-include=/usr/local/opt/libxml2/include/libxml2"
BUNDLE_BUILD__MYSQL2: "--with-opt-dir=/usr/local/opt/openssl"

git-killme should be thread-safe

verify that sha / branch has not changed immediately before

git checkout root
git reset --hard upstream/master

this will prevent checkout of fallback branch if a different branch was checked out async while the prune network request ran

`git killme` should gracefully handle a repo with no commits

intelligence ⭠ master ❯ g km
error: malformed object name origin/fatal:
bash: line 1: Use: command not found
bash: line 2: git <command> [<revision>...] -- [<file>...]: command not found
Deleting fatal: ambiguous argument 'HEAD': unknown revision or path not in the working tree.
Use '--' to separate paths from revisions, like this:
'git <command> [<revision>...] -- [<file>...]'
HEAD from origin...
❯ git push origin :fatal: ambiguous argument 'HEAD': unknown revision or path not in the working tree.
Use '--' to separate paths from revisions, like this:
'git <command> [<revision>...] -- [<file>...]'
HEAD
fatal: invalid refspec ':fatal:'
bash: line 1: Use: command not found
bash: line 2: git <command> [<revision>...] -- [<file>...]: command not found
error: malformed object name upstream/fatal:
bash: line 1: Use: command not found
bash: line 2: git <command> [<revision>...] -- [<file>...]: command not found
Deleting fatal: ambiguous argument 'HEAD': unknown revision or path not in the working tree.
Use '--' to separate paths from revisions, like this:
'git <command> [<revision>...] -- [<file>...]'
HEAD from upstream...
❯ git push upstream :fatal: ambiguous argument 'HEAD': unknown revision or path not in the working tree.
Use '--' to separate paths from revisions, like this:
'git <command> [<revision>...] -- [<file>...]'
HEAD
fatal: invalid refspec ':fatal:'
bash: line 1: Use: command not found
bash: line 2: git <command> [<revision>...] -- [<file>...]: command not found
❯ git checkout root 2>/dev/null
❯ git checkout root 2>/dev/null || git checkout -b root
Switched to a new branch 'root'
❯ git reset --hard
❯ git branch -D fatal: ambiguous argument 'HEAD': unknown revision or path not in the working tree.
Use '--' to separate paths from revisions, like this:
'git <command> [<revision>...] -- [<file>...]'
HEAD
error: branch 'fatal:' not found.
error: branch 'ambiguous' not found.
error: branch 'argument' not found.
error: branch 'HEAD:' not found.
error: branch 'unknown' not found.
error: branch 'revision' not found.
error: branch 'or' not found.
error: branch 'path' not found.
error: branch 'not' not found.
error: branch 'in' not found.
error: branch 'the' not found.
error: branch 'working' not found.
error: branch 'tree.' not found.
bash: line 1: Use: command not found
bash: line 2: git <command> [<revision>...] -- [<file>...]: command not found

Handle branches with `/` characters in git killme

style ⭠ Layout/SpaceAroundEqualsInParameterDefault ❯ g kmf
Deleting Layout/SpaceAroundEqualsInParameterDefault from origin...
To https://github.com/drn/style-guide.git
 - [deleted]         Layout/SpaceAroundEqualsInParameterDefault
sed: 1: "/Layout/SpaceAroundEqua ...": invalid command code S
Switched to branch 'root'
sed: 1: "/Layout/SpaceAroundEqua ...": invalid command code S
HEAD is now at c7b16e3 Set SpaceAroundEqualsInParameterDefault to no_spaces.
Deleted branch Layout/SpaceAroundEqualsInParameterDefault (was c7b16e3).

https://github.com/drn/dots/blob/master/git/functions/git-killme#L39

Control Spotify starring via Hammerspoon

Unfortunately, Spotify does not provide any Osascript scripting hooks into toggling the track as saved & not saved. However, Spotify does provide API access to control this functionality.

Steps:

  • Only run the following if missing variables in ~/.spotify/config
  • Create Spotify API application with:
    • at least the user-library-modify and user-read-currently-playing scopes
    • redirect_uri as drn.dev/spotify/callback
  • Store Client ID & Client Secret in ~/.spotify/config
  • Generate URL to https://accounts.spotify.com/authorize?client_id=#{client_id}&redirect_uri=https%3A%2F%2Fdrn.dev%2Fspotify%2Fcallback&response_type=code&scope=user-read-currently-playing+user-library-modify&state=${...}
  • drn.dev/spotify/callback to display a message and copy returned token to
    • https://drn.dev/spotify/callback?code=#{...}&state=#{...}
  • Paste code into CLI, which exchanges code for access token and refresh token
  • CLI stores access token and refresh token in ~/.spotify/config
  • Check if access token is valid. If invalid, generate new token via refresh token
  • Fetch current track id
  • Check Saved Tracks
  • Save Track or Remove Track
  • Add Hammerspoon binding into this CLI command, displaying hs.alert based on response and error state from CLI command

Notes:

  • Consider handling this as a separate project

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.