Are you having trouble checking out someone's pullrequest from a terminal?
Example usage
git clone git@github.com:example/example.git
ghpr someuser:somebranch # Copy this from the PR
It does these things
- Adds someuser as a git remote
Are you having trouble checking out someone's pullrequest from a terminal?
Example usage
git clone git@github.com:example/example.git
ghpr someuser:somebranch # Copy this from the PR
It does these things
To open the command prompt <Cmd> + <Shift + p. Or use <Cmd> + p and type >
Open the command prompt and type >Extensions: Install Extensions, there you can search for and
install the extensions below.
As a vim:er I'm used to selecting a few lines with V and then pressing gq to wrap them.
Very handy for markdown files, git commit body etc.
Today I wanted to make a recording of me running some commands inside a docker-container.
❯ docker-compose run app bash
root@e9bb2af4dc11:/usr/local/go/src/example.com/dev/project#
Needless to say it looked a bit bland with no colors and a long prompt that prevents me from recording a small terminal and show the full commands I'm
Here are some tricks you can use to be able to stay on the home row (asdfghjkl etc) when you're in a terminal or in vim.
<Ctrl>+l Clear the terminal<Ctrl>+a go to beginning of line<Ctrl>+e go to end of line<Ctrl>+p instead of <Up>, to see previous command<Ctrl>+n instead of <Down>, to see next command<Ctrl>+k + <Ctrl>+u Cut current command+y Paste command| import test from 'ava' | |
| import deepFreeze from 'deep-freeze' | |
| import omit from 'lodash/omit' | |
| test('normal delete will mutate the object', t => { | |
| const obj = { a: 1, b: 2 } | |
| deepFreeze(obj) | |
| t.throws(() => delete obj.a) | |
| }) |
| ssh deploy@some-server | |
| # Upgrade ruby-build (So it knows about the new ruby version and so can fetch it for us) | |
| cd ~/.rbenv/plugins/ruby-build | |
| git pull | |
| # Grab a coffee while downloading ruby | |
| rbenv install 2.2.4 | |
| # Make sure bundle command is available |
| source "https://rubygems.org" | |
| gem 'mysql2' | |
| gem 'activerecord' | |
| gem 'safe_attributes' |
The version below is specifically tailored to handle a model named Item where the attachment is called image.
#!/usr/bin/env ruby
require "fileutils"
if File.directory? "public/system/items/images"
puts "Nothing to do, you've already done this"
exit 0Have you seen the excellent https://istheinternetonfire.com/ website?
They provide a nice dns txt api that I decided to use the give myself an OSX notification whenever they update.
Save the following to a file somewhere in your $PATH. I chose .bin/istheinternetonfire
#!/usr/bin/env bash