Skip to content

Instantly share code, notes, and snippets.

View patevs's full-sized avatar
🥝

Pat patevs

🥝
View GitHub Profile
@joelgriffith
joelgriffith / Login-Page.js
Created July 11, 2017 16:48
Simple React login-page for testing
import React, { Component } from 'react';
import './App.css';
class LoginPage extends Component {
constructor() {
super();
this.state = {
username: '',
password: '',
error: '',
@brettinternet
brettinternet / check-git-2.sh
Created July 6, 2017 23:54
Check if directory is a git repo or not
# from https://stackoverflow.com/questions/2180270/check-if-current-directory-is-a-git-repository
[ -d .git ] || git rev-parse --git-dir > /dev/null 2>&1
# output all the colour combinations for text/background
# https://stackoverflow.com/questions/20541456/list-of-all-colors-available-for-powershell/41954792#41954792
$colors = [enum]::GetValues([System.ConsoleColor])
Foreach ($bgcolor in $colors){
Foreach ($fgcolor in $colors) { Write-Host "$fgcolor|" -ForegroundColor $fgcolor -BackgroundColor $bgcolor -NoNewLine }
Write-Host " on $bgcolor"
}
@dfontana
dfontana / CmderZSH.md
Last active February 17, 2025 16:20
My setup guide for installing Cgywin, Mintty, Cmder, and ZSH.

What's this?

Instructions to obtain ZSH on a windows environment, without the input funny business presented by some other attempted solutions.

The final result is ZSH running on a mintty terminal, emulated by cygwin, and being handled by the popular cmder.

Why is this here?

For the benefit of myself and others. I've already followed these instructions twice. It took me hours to figure all this out, maybe someone else can save a few.

What exactly is covered?

  • Installing and setting up cmder
@jmpinit
jmpinit / cmd-exists.js
Last active February 22, 2020 20:06
Node.js: Check if a command exists
// returns a Promise which fulfills with the result of a shell command
// rejects with stderr
function run(command) {
return new Promise((fulfill, reject) => {
exec(command, (err, stdout, stderr) => {
if (err) {
reject(err);
return;
}
@subfuzion
subfuzion / README.md
Last active February 27, 2025 07:38
vim/neovim configuration

I recently switched over to neovim (see my screenshots at the bottom). Below is my updated config file.

It's currently synchronized with my .vimrc config except for a block of neovim-specific terminal key mappings.

This is still a work in progress (everyone's own config is always a labor of love), but I'm already extremely pleased with how well this is working for me with neovim. While terminal mode isn't enough to make me stop using tmux, it is quite good and I like having it since it simplifies my documentation workflow for yanking terminal output to paste in a markdown buffer.

These days I primarily develop in Go. I'm super thrilled and grateful for fatih/vim-go,

@noeldiaz
noeldiaz / README.md
Created September 21, 2016 02:16
Clone repository and cd into the directory

Installation

You can add the gcd script to your local bin path or you can add the followin snippet to your bash .profile or zsh .zshrc file.

function gcd {
  REPO=$1
  CLONEPATH=$2

 if [ -z $CLONEPATH ]; then
@mlocati
mlocati / win10colors.cmd
Last active March 6, 2025 10:25
ANSI Colors in standard Windows 10 shell
@echo off
setlocal
call :setESC
cls
echo %ESC%[101;93m STYLES %ESC%[0m
echo ^<ESC^>[0m %ESC%[0mReset%ESC%[0m
echo ^<ESC^>[1m %ESC%[1mBold%ESC%[0m
echo ^<ESC^>[4m %ESC%[4mUnderline%ESC%[0m
@steinwaywhw
steinwaywhw / One Liner to Download the Latest Release from Github Repo.md
Last active March 9, 2025 05:53
One Liner to Download the Latest Release from Github Repo
  • Use curl to get the JSON response for the latest release
  • Use grep to find the line containing file URL
  • Use cut and tr to extract the URL
  • Use wget to download it
curl -s https://api.github.com/repos/jgm/pandoc/releases/latest \
| grep "browser_download_url.*deb" \
| cut -d : -f 2,3 \
| tr -d \" \
@kadet1090
kadet1090 / prompt.ps1
Created March 21, 2016 17:33
PowerLine like prompt for PowerShell
$script:bg = [Console]::BackgroundColor;
$script:first = $true;
$script:last = 0;
function Write-PromptFancyEnd {
Write-Host  -NoNewline -ForegroundColor $script:bg
$script:bg = [System.ConsoleColor]::Black
}