Skip to content

Instantly share code, notes, and snippets.

View jackd942's full-sized avatar

Jack Davis jackd942

View GitHub Profile
@jackd942
jackd942 / PYTHON_DEFAULT.md
Created January 10, 2022 15:43 — forked from patrickmmartin/PYTHON_DEFAULT.md
update-alternatives for python3 on Ubuntu

Ubuntu 16 default python is almost python 3

Loads of solutions exist, but for changing the system default, alias is not the way to go.

$ update-alternatives --list python update-alternatives: error: no alternatives for python

@jackd942
jackd942 / install-zsh-windows-git-bash.md
Created May 31, 2021 16:42 — forked from fworks/install-zsh-windows-git-bash.md
Zsh / Oh-my-zsh on Windows Git Bash
@jackd942
jackd942 / git.migrate
Created February 19, 2021 14:56 — forked from niksumeiko/git.migrate
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.

Phoenix 1.4.x to 1.5.0 upgrade instructions

Phoenix 1.5 requires Elixir >= 1.7. Be sure your existing version is up to date by running elixir -v on the command line.

Install the new phx.new project generator

$ mix archive.uninstall phx_new
$ mix archive.install hex phx_new 1.5.0
@jackd942
jackd942 / Shell Shortcuts
Last active March 21, 2020 20:04 — forked from acamino/README.md
Shortcuts to Improve Your Bash & Zsh Productivity
### Shortcut — Action
- [x] `CTRL + A` — Move to the beginning of the line
- [x] `CTRL + E` — Move to the end of the line
- [ ] `CTRL + [left arrow]` — Move one word backward (on some systems this is ALT + B)
- [ ] `CTRL + [right arrow]` — Move one word forward (on some systems this is ALT + F)
- [ ] `CTRL + U` — (bash) Clear the characters on the line before the current cursor position
- [ ] `CTRL + U` —(zsh) If you're using the zsh, this will clear the entire line
- [ ] `CTRL + K` — Clear the characters on the line after the current cursor position
- [ ] `ESC + [backspace]` — Delete the word in front of the cursor
@jackd942
jackd942 / fabric-poster-maker.markdown
Created September 20, 2019 04:03
Fabric poster maker

Fabric poster maker

mock up poster maker using fabric.js and google fonts.

A Pen by Rhys on CodePen.

License.

@jackd942
jackd942 / gist:3fb67c79b30e15ea3701431d327ad3f7
Created July 17, 2019 01:26 — forked from arjunvenkat/gist:1115bc41bf395a162084
Seeding a Rails database with a CSV file

How to seed a Rails database with a CSV file

1. Setup

First, Create a folder inside of lib called seeds

Put your CSV file example.csv into the lib/seeds folder. In the example below, the file is called real_estate_transactions.csv

Make sure you've created a resource with the appropriate columns to match your seed data. The names don't have to match up.

@jackd942
jackd942 / slice_length_capacity.go
Created December 2, 2018 17:05
Slice length and capacity
package main
import "fmt"
func main() {
s := []int{2, 3, 5, 7, 11, 13}
printSlice(s)
// Slice the slice to give it zero length
s = s[:0]

Keybase proof

I hereby claim:

  • I am jackd942 on github.
  • I am jackd942 (https://keybase.io/jackd942) on keybase.
  • I have a public key ASDnCCzRsyWAYGUfrc1AZOhuZS0_PIzH7f1N5LN6zCz0jAo

To claim this, I am signing this object:

@jackd942
jackd942 / _ticket-control.js
Created April 22, 2018 23:25 — forked from dmeents/_ticket-control.js
How to create a React.js ticketing system using Redux-Form and a MongoDB
//server/controllers/_ticket-control.js
'use strict';
const Tickets = require('../models/tickets');
//===================
// Create Tickets Route
//===================
exports.createTicket = function(req, res, next) {