Skip to content

Instantly share code, notes, and snippets.

#!/bin/bash
# ~/.bash_profile
# Add your SSH key to SSH Agent
eval `keychain --eval --agents ssh id_rsa_winuser1`
# Now you don't have to add your SSH key to agent (`ssh-add`) before you commit to github.
# end
@rasor
rasor / sparse checkout
Created March 21, 2021 19:39 — forked from werty1st/sparse checkout
git sparse checkout
What you are trying to do is called a sparse checkout, and that feature was added in git 1.7.0 (Feb. 2012). The steps to do a sparse clone are as follows:
git init <repo>
cd <repo>
git remote add -f origin <url>
This creates an empty repository with your remote. Then do:
git config core.sparsecheckout true
Now you need to define which files/folders you want to actually check out. This is done by listing them in .git/info/sparse-checkout, eg:
@rasor
rasor / web.config
Created May 15, 2020 16:35 — forked from maxan/web.config
IIS Config to React Router App
<system.webServer>
<rewrite>
<rules>
<rule name="React Routes" stopProcessing="true">
<match url=".*" />
<conditions logicalGrouping="MatchAll">
<add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true" />
<add input="{REQUEST_FILENAME}" matchType="IsDirectory" negate="true" />
<add input="{REQUEST_URI}" pattern="^/(api)" negate="true" />
</conditions>

Keybase proof

I hereby claim:

  • I am rasor on github.
  • I am rasor (https://keybase.io/rasor) on keybase.
  • I have a public key ASD0ejd_0y1Ls_D_RQIyxfzxUtkfk6wGf27z47tbTFs--Qo

To claim this, I am signing this object:

#!/bin/bash
# Start VueStorefront frontend
# Location: /project-root-above-vue-storefront/vs3.sh
# Prerequisites: DVueStorefront API from vsapi2.sh must be running
cd vue-storefront
# Open browser
start http://localhost:3000
# start VueStorefront
yarn dev
@rasor
rasor / launch.json
Last active May 20, 2018 11:36
VSCode - Attach to NodeMon
{
// Location: /project-root-containing-package-json/.vscode/launch.json
// Use --inspect in your nodemon start . e.g. "nodemon --inspect ./bin/www"
// Info: NodeMon uses port 9229 - you can swap to any other port that fits your needs
//
// More information, visit: https://go.microsoft.com/fwlink/?linkid=830387 and
// https://github.com/Microsoft/vscode-recipes/tree/master/nodemon
"version": "0.2.0",
"configurations": [
{
@rasor
rasor / find-filename.sh
Last active October 7, 2018 12:34
various-bash-shell-scripts
#!/bin/bash
# Find files (subfolder included -R) having somesearchstring in filename (and ignore case -i)
# Usage: sh find-filename.sh somesearchstring
# https://stackoverflow.com/questions/11328988/linux-find-files-with-name-containing-string/11329078#comment92302732_11329078
ls -R | grep -i $1
# If you only want to find PDF files
# ls -R | grep -i $1 | grep -F -i '.pdf'
@rasor
rasor / occli.sh
Last active April 23, 2018 19:12
Startup script for MiniShift
#!/bin/bash
# occli.sh
echo "Enable oc CLI"
eval $(minishift oc-env)
# done
@rasor
rasor / SqlAddGroupToDbo.sql
Created April 17, 2018 11:43
SQL Add Users and Groups
/*
USE [master]
GO
CREATE LOGIN [EUROP\SomeAdministrators] FROM WINDOWS WITH DEFAULT_DATABASE=[master], DEFAULT_LANGUAGE=[us_english]
GO
*/
--USE [DK_dev]
GO
@rasor
rasor / PrintSqlDbs.sql
Created April 17, 2018 11:31
Print all MS SQL DB's on a server
-- Print all MS SQL DB's on a server
SELECT name FROM master.dbo.sysdatabases
WHERE name NOT IN ('master', 'tempdb', 'model', 'msdb');