Skip to content

Instantly share code, notes, and snippets.

View JasonMorgan's full-sized avatar

Jason Morgan JasonMorgan

View GitHub Profile
@niksumeiko
niksumeiko / git.migrate
Last active November 10, 2024 18:26
Moving git repository and all its branches, tags to a new remote repository keeping commits history
#!/bin/bash
# Sometimes you need to move your existing git repository
# to a new remote repository (/new remote origin).
# Here are a simple and quick steps that does exactly this.
#
# Let's assume we call "old repo" the repository you wish
# to move, and "new repo" the one you wish to move to.
#
### Step 1. Make sure you have a local copy of all "old repo"
### branches and tags.
@Jaykul
Jaykul / ShouldaBeenABlogPost.md
Last active January 25, 2021 07:37
Methods without parenthesis is a language feature, not a where/foreach thing.

There have been some twitter converstations about the Where and ForEach methods

It's like someone suddenly noticed they can be called without parenthesis, and when you do so, they look even more like the Where-Object and ForEach-Object cmdlets. I don't personally understand the problem with that -- they are, after all, exactly like those cmdlets, except for three things:

  1. The method is blocking (vs. streaming)
  2. The where method has some optional additional parameters
  3. The methods are very fast

Of course, teaching these methods is complicated, because they don't show up in Get-Member, and they're virtually undocumented. In fact, it could be argued that you shouldn't use them or teach them at all. Except, did I mention they're blazingly fast?

@aleliaert
aleliaert / bash_rc_sourceme.sh
Last active October 25, 2017 19:44
Bash functions for easier use of CF CLI
#
# Some bash functions to help use the cf cli more easily
# Include in your .bashrc directly or place in another file and source
#
#
# cfhome
#
# Get a new cf home
# Use no args to get a uniquely-scoped home