This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Function SimpleContextMenu { | |
param ( | |
[Parameter(Mandatory, Position = 0)] | |
[System.Object] | |
$List, | |
[Parameter(Mandatory = $false, Position = 1)] | |
[string] | |
$Header = "Select" | |
) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Git Helpers | |
function _git_url { | |
return $(git config --get remote.origin.url) | |
} | |
function _git_root { | |
$gitDir = git rev-parse --git-dir | |
if ($null -eq $gitDir) { | |
return $null |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Git Helpers | |
function fn_git_branch { & git branch } | |
New-Alias -Name gb -Value fn_git_branch -Force -Option AllScope | |
function fn_git_checkout_master { & git checkout master } | |
New-Alias -Name master -Value fn_git_checkout_master -Force -Option AllScope | |
New-Alias -Name gb -Value fn_git_branch -Force -Option AllScope | |
function fn_git_checkout_main { & git checkout main } | |
New-Alias -Name main -Value fn_git_checkout_main -Force -Option AllScope | |
function fn_git_status { & git status } | |
New-Alias -Name gs -Value fn_git_status -Force -Option AllScope |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Function SimpleContextMenu { | |
param ( | |
[Parameter(Mandatory, Position = 0)] | |
[System.Object] | |
$List, | |
[Parameter(Mandatory = $false, Position = 1)] | |
[string] | |
$Header = "Select" | |
) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# ~/.bash_profile | |
# You can load both rvm and asdf in ~/.bash_profile | |
# This makes it easy to switch what to load | |
# RVM | |
# source $HOME/.rvm/scripts/rvm | |
# ASDF | |
. $HOME/.asdf/asdf.sh |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// | |
// main.cpp | |
// SortingAlgorithms | |
// | |
// Created by Stephen Baidu on 9/8/14. | |
// Copyright (c) 2014 Stephen Baidu. All rights reserved. | |
// | |
#include <iostream> | |
#include <vector> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module Resourcify | |
extend ActiveSupport::Concern | |
included do | |
before_action :set_resource, only: [:show, :update, :destroy] | |
end | |
def index | |
@resources = resource_class.all | |
end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# ~/.railsrc | |
--database=postgresql | |
--skip-test-unit | |
--skip-turbolinks | |
--skip-spring | |
--skip-coffee | |
--skip-bundle |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class FlattenArray | |
attr_reader :result | |
def initialize(array) | |
@array = array | |
end | |
def call | |
@result = flatten(@array) || [] | |
@result |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def flatten(element) | |
return [element] unless element.is_a?(Array) | |
element.map{|e| flatten(e) }.inject(:+) | |
end |
NewerOlder