Skip to content

Instantly share code, notes, and snippets.

View kevinah95's full-sized avatar
🇨🇷

Kevin Hernández Rostrán kevinah95

🇨🇷
View GitHub Profile
@rahularity
rahularity / work-with-multiple-github-accounts.md
Last active July 22, 2024 21:07
How To Work With Multiple Github Accounts on your PC

How To Work With Multiple Github Accounts on a single Machine

Let suppose I have two github accounts, https://github.com/rahul-office and https://github.com/rahul-personal. Now i want to setup my mac to easily talk to both the github accounts.

NOTE: This logic can be extended to more than two accounts also. :)

The setup can be done in 5 easy steps:

Steps:

  • Step 1 : Create SSH keys for all accounts
  • Step 2 : Add SSH keys to SSH Agent
@danieldogeanu
danieldogeanu / RenameGitBranch.md
Last active June 11, 2024 12:27
How to rename your Git master branch to main.

To rename your Git master branch to main, you must do the following steps:

  1. Navigate to your repository in the command line and issue the following commands: - git branch -m master main - git push -u origin main

  2. Change your default branch on GitHub by going to your GitHub repository in your browser, and navigate to Settings > Branches and click on the dropdown and switch from master to main and click Update (this will only show if you have two or more branches). The main branch is now your default branch.

  3. Update the tracking of the branch from your command line with the following command: - git branch -u origin/main main

@chriscamacho
chriscamacho / compo.c
Last active June 16, 2020 20:08
Raylib 32x32 competition template
/**********************************************************************************************
*
* raylib 32x32 game/demo competition
*
* Competition consist in developing a videogame in a 32x32 pixels screen size.
*
* RULES:
*
* 1) Use only raylib (and included libraries), no external libraries allowed
* 2) The submission should consist of just one source file
@markwragg
markwragg / Sort-Natural.ps1
Last active February 5, 2024 12:16
PowerShell natural sort. A regex way to sort files that have a number in them correctly, e.g rather than img1, img10, img11, img2, -> img1, img2, img10, img11
# http://stackoverflow.com/a/5429048/2796058
$ToNatural = { [regex]::Replace($_, '\d+', { $args[0].Value.PadLeft(20) }) }
Get-ChildItem | Sort-Object $ToNatural
@kamsar
kamsar / msbuild.ps1
Last active April 11, 2024 02:14
PowerShell to resolve MSBuild.exe on VS2017 or VS2015 (or with Build Tools 2015)
function Resolve-MsBuild {
$msb2017 = Resolve-Path "${env:ProgramFiles(x86)}\Microsoft Visual Studio\*\*\MSBuild\*\bin\msbuild.exe" -ErrorAction SilentlyContinue
if($msb2017) {
Write-Host "Found MSBuild 2017 (or later)."
Write-Host $msb2017
return $msb2017
}
$msBuild2015 = "${env:ProgramFiles(x86)}\MSBuild\14.0\bin\msbuild.exe"
@ccnokes
ccnokes / rx-online-offline.js
Last active October 11, 2022 14:18
Online/offline event observable with RxJS (see comments below for a better, more up-to-date way of doing this)
const { Observable } = require('rxjs/Observable');
require('rxjs/add/observable/fromEvent');
require('rxjs/add/operator/map');
require('rxjs/add/observable/merge');
function createOnline$() {
//merge several events into one
return Observable.merge(
//use .map() to transform the returned Event type into a true/false value
Observable.fromEvent(window, 'offline').map(() => false),
@datchley
datchley / react-redux-style-guide.md
Last active February 13, 2024 14:30
React + Redux Style Guide
@kangax
kangax / quicksort.hs
Last active September 5, 2021 19:44
Haskell-inspired quick sort in ES6
quicksort :: (Ord a) => [a] -> [a]
quicksort [] = []
quicksort (x:xs) =
let smallerSorted = quicksort (filter (<=x) xs)
biggerSorted = quicksort (filter (>x) xs)
in smallerSorted ++ [x] ++ biggerSorted

Contributing

When contributing to this repository, please first discuss the change you wish to make via issue, email, or any other method with the owners of this repository before making a change.

Please note we have a code of conduct, please follow it in all your interactions with the project.

Pull Request Process

  1. Ensure any install or build dependencies are removed before the end of the layer when doing a
@xanathar
xanathar / iis7_command_line_tool.md
Last active May 22, 2023 12:01 — forked from jonlabelle/iis7_command_line_tool.md
IIS 7 Command Line Tool

IIS 7 Command Line Tool

AppCmd.exe IIS 7 command-line tool used to perform common IIS administrative tasks such as creating new sites, stopping/starting services, and viewing status of the site.

Usage

appcmd (command) (object-type) <identifier> </parameter1:value1 ...>