Open Side Menu Go to the Top
Register
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** ** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD **

10-14-2018 , 10:06 PM
Quote:
Originally Posted by suzzer99
It does exactly what you are trying to do - make a bunch of crazy changes, or debugging stuff, then walk through them and decide which to keep and which to throw away. There is no command line equivalent that's anywhere near as easy. Except stash - but that stashes everything. You can't pick and choose.

When you're talking about creating a whole new repo as an alternative that should tell you you're doing something too hard.
I'll look into it. I do have github desktop on the computer here. Is that similar?

I'm sure y'all have had times where you made a bunch of changes and things got out of hand and you just wanted to start over fresh without going through each change. That was me just now.

I'm not trying to be hipster here - maybe people are just different - but the learning curve is generally less steep for me with command line stuff. I do not like searching all over the screen for icons and through menus. And for carpal tunnel sake I try to avoid using the mouse as much as possible.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
10-14-2018 , 10:10 PM
If you want to start over just stash your changes (git stash plus whatever command line flags and crap I don't have to memorize).
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
10-14-2018 , 11:07 PM
I'm starting to wonder if I should just try and spend the time to go through a book like
Quote:
Cracking the Coding Interview
I expect I would need to spend a little time in Java first before anything in the book would make sense. Does this seem like a worthwhile endeavor?
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
10-15-2018 , 08:23 AM
Quote:
Originally Posted by goofyballer
Interesting article: Canada trying to snap up Silicon Valley immigrant talent



They're offering a much more flexible and promising alternative to H-1Bs:


There’s a pretty steady stream of articles like this and my local anecdotal evidence backs it up. Although a portion of it is just that the us tech market is doing so well that it makes sense there are going to be large spillover effects elsewhere. Hard to separate out the various effects without more serious analysis then articles like this will do.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
10-15-2018 , 11:15 AM
git reset --hard

That will get rid of all changes since the last commit.

git checkout filename

That will get rid of all changes since the last commit for the specified file or directory
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
10-15-2018 , 11:25 AM
Master, sounds like you are just working off master/origin. I would recommend creating a new branch (git checkout -b new-branch-name) and then you can always go back to master and create another clean branch to work on.

And when you make some worthwhile code on a branch and you really like it and want to add it to your app/project for good, then you can push that branch up to master and it gets merged and becomes part of masyer.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
10-15-2018 , 12:59 PM
Quote:
Originally Posted by Victor
Master, sounds like you are just working off master/origin. I would recommend creating a new branch (git checkout -b new-branch-name) and then you can always go back to master and create another clean branch to work on.

And when you make some worthwhile code on a branch and you really like it and want to add it to your app/project for good, then you can push that branch up to master and it gets merged and becomes part of masyer.
I probably shouldn't be using git for what I'm doing at all and should probably just ssh some stuff onto a server which I have access to and just make backups when I feel like it, but I just want to play around with git. But, I must not be the only one doing this....

Don't people work on a project at one computer sometimes and on another at other times? I used to just always ssh into a remote server and do everything on that, but I wanted to try developing locally this time - can even work offline. But that means I may work for a couple hours on one computer and be in the middle of something and then switch to another and pick up right where I left off. I can do that by using github to keep everything in sync. If you guys operated like that would you check out a branch every time you started work? Everything is dev right now. I could do all of this on a different branch than master, but at this point that seems silly. There is no big codebase to preserve.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
10-15-2018 , 01:03 PM
Git seems like the right tool for this and much easier than anything involving manually copying files.

Hard to say what my workflow would be like, but I'd probably have master and feature branches. Branches are free and easy to create. Why not use them?

At the very least I'd have two branches: master (code you know you want) and dev (any code you're currently working on). It's also really easy to revert to a known commit. So if you do some work on computer A, commit it to move to computer B, and then decide you want to throw the whole thing away -> you just revert to the known good state or rebranch from master.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
10-15-2018 , 01:20 PM
Quote:
Originally Posted by microbet
I probably shouldn't be using git for what I'm doing at all and should probably just ssh some stuff onto a server which I have access to and just make backups when I feel like it, but I just want to play around with git. But, I must not be the only one doing this....

Don't people work on a project at one computer sometimes and on another at other times? I used to just always ssh into a remote server and do everything on that, but I wanted to try developing locally this time - can even work offline. But that means I may work for a couple hours on one computer and be in the middle of something and then switch to another and pick up right where I left off. I can do that by using github to keep everything in sync. If you guys operated like that would you check out a branch every time you started work? Everything is dev right now. I could do all of this on a different branch than master, but at this point that seems silly. There is no big codebase to preserve.
Yeah in this case just make a dev branch for what you're doing then push it to your git remote, and pull it back down on the other computer. Having a dev branch that doesn't pollute master accomplishes exactly what you want. When you're happy with it then do a pull request to master. A pull request gives you a nice permanent snapshot of your feature.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
10-15-2018 , 02:07 PM
So you never push to master? You submit a pull request (? I haven't done this yet) and then you have to go onto github and accept the request/do the pull from there?

I definitely get this if it's a big project and the developer doing their own little changes isn't supposed to be the one deciding when to change master.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
10-15-2018 , 02:10 PM
Yeah you probably don't need to. But I think it makes a nice snapshot if you want to go back and try to remember what you added for a particular feature. Here's an example. https://github.com/aws-amplify/ampli...ull/1801/files
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
10-15-2018 , 02:15 PM
Yeah, the PR is up to you. I think the important thing here is that master would be your stable branch and you'd merge code into it when you're happy with it and know you want to keep those commits around for a long time.

Just think of each merge/commit there as a save point of a known good state of your project.

Edit: This is different than your other branches (or just single dev branch) where you'd often be committing broken code / code you're not sure about just to back it up and/or move it between computers.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
10-15-2018 , 03:52 PM
Quote:
Originally Posted by blackize5
git reset --hard

That will get rid of all changes since the last commit.

git checkout filename

That will get rid of all changes since the last commit for the specified file or directory


reset —hard won’t get rid of untracked stuff.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
10-15-2018 , 04:51 PM
Ok well if anyone is curious, after 2 days of rabbit holes I finally figured out how to get the AWS public keys into the PEM format that jwt.io expects by following this post, combined with the usage of the jwk-to-pem package here.

Code:
const jwkToPem = require('jwk-to-pem');

const awsPublicKey  = {
  alg: "RS256",
  e: "AQAB",
  kid: "FDYc3/dIQSHEhRDIj00TvDwc3XPadxsAGGCTdskt0mY=",
  kty: "RSA",
  n: "jN7TL705q33CeJHgIzQVfg5YFFfl3ta4nnBIi1DccxOUE1AH8lyRP7CguAfdVVkggf3w8OlBb_FOTlFishAkukUvnhPGIklxVkBZK8fj7q09BB8A2GGXRUX0xUUsREmGR487IxUw0DzPVfdpMmcZKt4jYK64HilfP-Nbfnq1BSqBBuuOsSjWa1myc9KgAGOMSXSmabTQM91yY3imuP5ldORsl009qEJBmh9f9HRnp9UhuwOixuwM54kVkgEUS065q4vpczvgiDm9dejkijtfa3Zi1Eh1dAeXHSF9cbhMT3j2V1k1Uj3b5VwrV95llNiUDlrbOmtWgOY3Vljeh6-Aow",
  use: "sig"
};

// just demonstrating which values are needed  jwkToPem(awsPublicKey) works too.
const jwk = { kty: awsPublicKey.kty, n: awsPublicKey.n, e: awsPublicKey.e}; 

const pem = jwkToPem(jwk);

console.log(pem);
Produces a nice pretty output that looks like this:

-----BEGIN PUBLIC KEY-----
MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAjN7TL7 05q33CeJHgIzQV
fg5YFFfl3ta4nnBIi1DccxOUE1AH8lyRP7CguAfdVVkggf3w8O lBb/FOTlFishAk
ukUvnhPGIklxVkBZK8fj7q09BB8A2GGXRUX0xUUsREmGR487Ix Uw0DzPVfdpMmcZ
Kt4jYK64HilfP+Nbfnq1BSqBBuuOsSjWa1myc9KgAGOMSXSmab TQM91yY3imuP5l
dORsl009qEJBmh9f9HRnp9UhuwOixuwM54kVkgEUS065q4vpcz vgiDm9dejkijtf
a3Zi1Eh1dAeXHSF9cbhMT3j2V1k1Uj3b5VwrV95llNiUDlrbOm tWgOY3Vljeh6+A
owIDAQAB
-----END PUBLIC KEY-----
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
10-15-2018 , 05:27 PM
Quote:
Originally Posted by microbet
So you never push to master? You submit a pull request (? I haven't done this yet) and then you have to go onto github and accept the request/do the pull from there?

I definitely get this if it's a big project and the developer doing their own little changes isn't supposed to be the one deciding when to change master.
you push your branch to master. that creates a pullrequest that you need to accept. then boom its on master. push and pull request are kind of confusing terms.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
10-15-2018 , 06:34 PM
Quote:
Originally Posted by suzzer99
My boss literally told a dev he had to use a gui git client and not the command line. I can't imagine if that had happened to a ton of posters itt.

To be fair this guy is pretty raw - not some command line rock star like everyone here
This happened to me. Apparently, command will scare our clients.

I know what I am doing with command line. What my boss can't see won't hurt him. On a completely unrelated note, he works in a different building to me at the moment.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
10-15-2018 , 07:25 PM
If you ever get caught using it, just tell him you needed to undo some changes with a push --force, which some GUI clients don't allow.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
10-15-2018 , 07:26 PM
It never fails to boggle my mind when I install something completely common like this aws client for mac and still get "aws - command not found" and then you have to go mucking with the PATH - which is set in about 10 different places now.

Shouldn't this be a solved problem by now?
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
10-15-2018 , 07:52 PM
Apple gives like zero ****s about devs. They just change **** for the hell of it and we wind up with a bunch of tools that break on every update
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
10-15-2018 , 08:15 PM
Quote:
Originally Posted by suzzer99
Ok well if anyone is curious, after 2 days of rabbit holes I finally figured out how to get the AWS public keys into the PEM format that jwt.io expects by following this post, combined with the usage of the jwk-to-pem package here.

Code:
const jwkToPem = require('jwk-to-pem');

const awsPublicKey  = {
  alg: "RS256",
  e: "AQAB",
  kid: "FDYc3/dIQSHEhRDIj00TvDwc3XPadxsAGGCTdskt0mY=",
  kty: "RSA",
  n: "jN7TL705q33CeJHgIzQVfg5YFFfl3ta4nnBIi1DccxOUE1AH8lyRP7CguAfdVVkggf3w8OlBb_FOTlFishAkukUvnhPGIklxVkBZK8fj7q09BB8A2GGXRUX0xUUsREmGR487IxUw0DzPVfdpMmcZKt4jYK64HilfP-Nbfnq1BSqBBuuOsSjWa1myc9KgAGOMSXSmabTQM91yY3imuP5ldORsl009qEJBmh9f9HRnp9UhuwOixuwM54kVkgEUS065q4vpczvgiDm9dejkijtfa3Zi1Eh1dAeXHSF9cbhMT3j2V1k1Uj3b5VwrV95llNiUDlrbOmtWgOY3Vljeh6-Aow",
  use: "sig"
};

// just demonstrating which values are needed  jwkToPem(awsPublicKey) works too.
const jwk = { kty: awsPublicKey.kty, n: awsPublicKey.n, e: awsPublicKey.e}; 

const pem = jwkToPem(jwk);

console.log(pem);
Produces a nice pretty output that looks like this:

-----BEGIN PUBLIC KEY-----
MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAjN7TL7 05q33CeJHgIzQV
fg5YFFfl3ta4nnBIi1DccxOUE1AH8lyRP7CguAfdVVkggf3w8O lBb/FOTlFishAk
ukUvnhPGIklxVkBZK8fj7q09BB8A2GGXRUX0xUUsREmGR487Ix Uw0DzPVfdpMmcZ
Kt4jYK64HilfP+Nbfnq1BSqBBuuOsSjWa1myc9KgAGOMSXSmab TQM91yY3imuP5l
dORsl009qEJBmh9f9HRnp9UhuwOixuwM54kVkgEUS065q4vpcz vgiDm9dejkijtf
a3Zi1Eh1dAeXHSF9cbhMT3j2V1k1Uj3b5VwrV95llNiUDlrbOm tWgOY3Vljeh6+A
owIDAQAB
-----END PUBLIC KEY-----
I told you this on Friday lol
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
10-15-2018 , 08:18 PM
At that point I was wedded to client-side. Also I think it didn't dawn on me how complicated just getting PEM format is. Crazy.

But yeah thanks your advice has been spot on. I was very deep in rabbit hole at the time.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
10-15-2018 , 08:19 PM
Btw this is what you have to do to make a note to yourself and other devs in package.json so you'll remember why you did something two months from now:

Code:
  "scripts": {
    "COMMENT ON BUILD BELOW!!!": "Using react-snapshot so that it will generate static pages for all routes and make cloudfront/s3 happy",
    "build": "react-scripts build && react-snapshot",
  }
But yeah JSON is awesome.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
10-15-2018 , 08:33 PM
Lol never thought of doing that. That will actually solve some problems. Sadly..

Sent from my ONEPLUS A5000 using Tapatalk
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
10-15-2018 , 08:35 PM
Signature off FFS ** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD **
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
10-15-2018 , 08:42 PM
Quote:
Originally Posted by suzzer99
Shouldn't this be a solved problem by now?
Yes, I feel like you should have solved this problem by now

There are a few places that are default binary locations, install stuff there and then you don't have to mess with your path. /usr/bin is where package managers usually put stuff, /usr/local/bin is where stuff you "manage yourself" usually gets put. You're probably installing the aws stuff with pip though, right? That should be in your path by default unless you installed python somewhere non-standard.

If there are 10 places you need to keep track of paths you're doing something wrong. I can think of... 2 or maybe 3. If you really have a lot then make a little bash script, like ~/.setpaths, set your paths in there, and source that anywhere that needs to have paths set.

bash is a programming language, not a config system, treat it like one - make programs/scripts/functions/libraries/etc
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote

      
m