Skip to content

Instantly share code, notes, and snippets.

View slugbyte's full-sized avatar
⌨️

Duncan Marsh slugbyte

⌨️
View GitHub Profile
@slugbyte
slugbyte / endianness.js
Created September 6, 2015 07:43
read node js buffer with correct endianness
'use strict';
var endianness = require('os').endianness();
var read8 = Buffer.prototype.readUInt8;
var read16 = Buffer.prototype['readUInt16' + endianness];
var read32 = Buffer.prototype['readUInt32' + endianness];
var readNumber = function(buf, readFunc, offset){
buf.readFunc = readFunc;
@slugbyte
slugbyte / simple-ansi-colors.sh
Created September 30, 2015 21:36
(light) ANSI Colors for using in shell scripts
WHT="\e[90m" #light black
RED="\e[91m" #light red
GRN="\e[92m" #light green
YLW="\e[93m" #light yellow
BLU="\e[94m" #light blue
PNK="\e[95m" #light magenta
CYN="\e[96m" #light cyan
WHT="\e[97m" #light white
FGD="\e[99m" #light default foreground color

Git REPO and YouTube Video Naming Standards

Git Repository layout

/(course_name)
|+ README.md //(#course-readme)
| 
|- 1st-week //(#weekly-directory)
| |
@slugbyte
slugbyte / trello-github-workflow.md
Last active June 6, 2019 09:22
Trello and Github Workflow

Team Project Workflow with Git and Trello

List Organization

  • Files
    • a card for every file in the project
  • Names
  • a list of all the names of the people each assigned a different color
  • Tasks
  • a list of features that need to be implemented

Handling Merge Conflicts

Issue

  • Some one on your project has merged a Pull Request into the master branch.
  • You push your code to your remote branch named branch_name and open a Pull Request to the master branch.
  • GitHub informs you your code can not automaticly merge into the master branch.

make an overview

Step by Step Solution

  1. Navigate to your project in your shell (the command line).

Rolling Back A Branch

Issue

  • You have been working on a project in a branch called branch_name and your code is not working.
  • You have spent some time trying to fix your code and its going no where.
  • You come to the conclusion that it would be better if you could start over from an earlier commit.
  • You want to roll back, but you dont want to loose any of your history.

Step by Step Solution

github and trello workflow

List Organization

  • Files
    • a card for every file in the project
  • Names
  • a list of all the names of the people each assigned a different color
  • Tasks
{
"rules": {
"no-console": 0,
"indent": [
2,
2
],
"quotes": [
2,
"single"
#!/usr/bin/env zsh
# This file will recursivly walk though a directory and
# create a nice looking README.md of all the source code.
# Usage $ markdownify <Output File Name>
#
# Installation:
# copy this code into a file called markdownify
# move markdownify into one of your directorys in $PATH
# chmod 755 /path/to/markdownify
[ $# -eq 0 ] && {

Working With Branches

Creating a Branch

  • make sure ur in the master branch by typing git branch
  • what ever branch you are in witll be green and have a * before it
  • if you not in master commit any current changes then run git chechout master to switch to the master branch
  • Make sure your branch is up to date with github by running git pull origin master
  • Now your ready to create a new branch
  • to create a new branch run git checkout -b name-of-branch