Skip to content

Instantly share code, notes, and snippets.

View ducksoupdev's full-sized avatar

Matt Levy ducksoupdev

View GitHub Profile
@ducksoupdev
ducksoupdev / git-aliases.md
Created October 10, 2016 19:25 — forked from mwhite/git-aliases.md
The Ultimate Git Alias Setup

The Ultimate Git Alias Setup

If you use git on the command-line, you'll eventually find yourself wanting aliases for your most commonly-used commands. It's incredibly useful to be able to explore your repos with only a few keystrokes that eventually get hardcoded into muscle memory.

Some people don't add aliases because they don't want to have to adjust to not having them on a remote server. Personally, I find that having aliases doesn't mean I that forget the underlying commands, and aliases provide such a massive improvement to my workflow that it would be crazy not to have them.

The simplest way to add an alias for a specific git command is to use a standard bash alias.

# .bashrc
@ducksoupdev
ducksoupdev / GitHub protocol comparison.md
Created October 11, 2016 10:38
A comparison of protocols offered by GitHub (for #git on Freenode).

Primary differences between SSH and HTTPS. This post is specifically about accessing Git repositories on GitHub.

Protocols to choose from when cloning:

plain Git, aka git://github.com/

  • Does not add security beyond what Git itself provides. The server is not verified.

    If you clone a repository over git://, you should check if the latest commit's hash is correct.

@ducksoupdev
ducksoupdev / undoManagerService.ts
Created October 20, 2016 08:14
Angular_1_undo_manager_service
namespace MyModule {
export interface IUndoCommand {
undo: Function;
redo: Function;
}
export interface IUndoManagerService {
add(command: IUndoCommand): IUndoManagerService;
setCallback(callback: Function);
@ducksoupdev
ducksoupdev / angularjs_directive_attribute_explanation.md
Created October 22, 2016 06:57 — forked from CMCDragonkai/angularjs_directive_attribute_explanation.md
JS: AngularJS Directive Attribute Binding Explanation

AngularJS Directive Attribute Binding Explanation

When using directives, you often need to pass parameters to the directive. This can be done in several ways. The first 3 can be used whether scope is true or false. This is still a WIP, so validate for yourself.

  1. Raw Attribute Strings

    <div my-directive="some string" another-param="another string"></div>
@ducksoupdev
ducksoupdev / powershell.json
Last active September 16, 2018 04:50 — forked from rkeithhill/powershell.json
PowerShell snippets file for Visual Studio Code - place in your ~\AppData\Roaming\Code\User\Snippets directory
{
"Condition statement": {
"prefix": "cond",
"body": [
"${_} { ${0}; break }"
],
"description": "Switch condition statement"
},
"Condition single quoted string statement": {
@ducksoupdev
ducksoupdev / systemjs_config.js
Created December 21, 2016 10:39
SystemJS Typescript loader
System.config({
//use typescript for compilation
transpiler: 'typescript',
//typescript compiler options
typescriptOptions: {
emitDecoratorMetadata: true
},
//map tells the System loader where to look for things
map: {
app: "./src"
alias ls='ls -F --color --show-control-chars'
alias ll='ls -l'
alias gits='git status '
alias gita='git add '
alias gitb='git branch '
alias gitc='git commit'
alias gitd='git diff'
alias gito='git checkout '
alias gitl='git log --graph --pretty=format:"%Cred%h%Creset %an: %s - %Creset %C(yellow)%d%Creset %Cgreen(%cr)%Creset" --abbrev-commit --date=relative'
alias gitr='git remote update'
function git-status { git status }
function git-add { git add $args }
function git-branch { git branch $args }
function git-commit { git commit $args }
function git-diff { git diff $args }
function git-checkout { git checkout $args }
function git-log { git log --graph --pretty=format:"%Cred%h%Creset %an: %s - %Creset %C(yellow)%d%Creset %Cgreen(%cr)%Creset" --abbrev-commit --date=relative }
function git-remote-update { git remote update }
function git-pull-rebase { git pull --rebase }
abstract class Foo {
protected abstract doSomething(): string;
}
class Bar extends Foo {
protected doSomething() {
return 'foo';
}
}
@ducksoupdev
ducksoupdev / tasks.json
Created March 2, 2017 08:49
VSCode tasks
{
"version": "0.1.0",
"command": "C:/source/github/ps-nvmw/vs/v6.9.4/tsc.cmd",
"isShellCommand": false,
"args": ["${file}"],
"showOutput": "silent",
"problemMatcher": "$tsc"
}