Skip to content

Instantly share code, notes, and snippets.

@AlbinoDrought
AlbinoDrought / gitBash_windows.md
Created July 6, 2020 17:49 — forked from evanwill/gitBash_windows.md
how to add more utilities to git bash for windows, wget, make

How to add more to Git Bash on Windows

Git for Windows comes bundled with the "Git Bash" terminal which is incredibly handy for unix-like commands on a windows machine. It is missing a few standard linux utilities, but it is easy to add ones that have a windows binary available.

The basic idea is that C:\Program Files\Git\mingw64\ is your / directory according to Git Bash (note: depending on how you installed it, the directory might be different. from the start menu, right click on the Git Bash icon and open file location. It might be something like C:\Users\name\AppData\Local\Programs\Git, the mingw64 in this directory is your root. Find it by using pwd -W). If you go to that directory, you will find the typical linux root folder structure (bin, etc, lib and so on).

If you are missing a utility, such as wget, track down a binary for windows and copy the files to the corresponding directories. Sometimes the windows binary have funny prefixes, so

@AlbinoDrought
AlbinoDrought / codes-canada.csv
Created April 9, 2020 22:00
Country Region Codes
Name Code
Alberta AB
British Columbia BC
Manitoba MB
New Brunswick NB
Newfoundland and Labrador NL
Northwest Territories NT
Nova Scotia NS
Nunavut NU
Ontario ON
@AlbinoDrought
AlbinoDrought / random-cowsay
Created March 20, 2020 18:47
Random Cowsay File
#!/bin/sh
cowsay -f $(ls /usr/share/cows | grep .cow | sed s/\\.cow$// | shuf -n 1)
@AlbinoDrought
AlbinoDrought / auto-tos-accept.user.js
Last active March 7, 2020 18:25
Automatically accept ToS and redeem Steam keys for those Humble Bundle "Redeem" links
// ==UserScript==
// @name Automatically accept ToS and redeem Steam keys
// @version 1
// @grant none
// @include https://store.steampowered.com/account/registerkey?key=*
// ==/UserScript==
window.addEventListener('load', function () {
var acceptTOS = document.querySelector('#accept_ssa');
if (acceptTOS) {
function wackRecording() {
if (!navigator.mediaDevices) {
console.error('getUserMedia not supported');
return Promise.reject();
}
const possibleCodecs = [
'video/webm',
'video/mp4',
];
@AlbinoDrought
AlbinoDrought / Dockerfile
Created July 17, 2019 21:06
Bastillion Dockerfile
FROM maven:3
ADD . /usr/src/app/
WORKDIR /usr/src/app
RUN git clone https://github.com/bastillion-io/lmvc.git && \
cd lmvc && \
mvn clean package install
RUN mvn package jetty:effective-web-xml
@AlbinoDrought
AlbinoDrought / creamy-cream.userscript.js
Last active July 16, 2019 22:55
Automatically rip commit details from bitbucket.org and pass them to a gotty script
// ==UserScript==
// @name Run creamy-cream build from bitbucket
// @version 1
// @grant none
// @match *://bitbucket.org/*/*/commits/*
// @match *://bitbucket.org/*/*/pull-requests/*
// @match *://bitbucket.org/*/*/branch/*
// ==/UserScript==
var element = document.createElement('button');
thingRoute(thing) {
for (let i = 0; i < this.data[1][0][1].length; i += 1) {
if(this.data[1][0][1][i].name === thing) {
this.things(this.data[1][0][1][i], i);
}
}
}
@AlbinoDrought
AlbinoDrought / vue_test_utils_cryptic_error.md
Last active June 13, 2019 17:42
@vue/test-utils error with vue-property-decorator, vue-class-component: "Property 'functional' is missing in type 'VueConstructor" [saved for later]

@vue/test-utils cryptic error

Encountered this and I know I'll end up making the same mistake again. Saving it here so I can hopefully find it on Bing ™️ in the future.

Error

Argument of type 'VueConstructor<Vue>' is not assignable to parameter of type 'FunctionalComponentOptions<Record<string, any>, PropsDefinition<Record<string, any>>>'.
  Property 'functional' is missing in type 'VueConstructor<Vue>' but required in type 'FunctionalComponentOptions<Record<string, any>, PropsDefinition<Record<string, any>>>'.
@AlbinoDrought
AlbinoDrought / README.md
Last active June 12, 2019 00:21
Drone 0.8 Bitbucket Fix "cannot find .drone.yml in refs/heads"

Drone 0.8 Bitbucket 1.0 Deprecation Fix

Download the diff to bitbucket-file-dl.diff after cloning

Applying directly into goroot:

go get -u github.com/drone/drone
cd $GOPATH/src/github.com/drone/drone
git fetch --all