Skip to content

Instantly share code, notes, and snippets.

View kggayo's full-sized avatar
🎯
Focusing

Kevin Gayo kggayo

🎯
Focusing
View GitHub Profile
@kggayo
kggayo / ngrok_iisexpress.txt
Created July 6, 2021 08:04
ngrok in visual studio
ngrok http 5146 -host-header="localhost:5146"
@kggayo
kggayo / sfcluster.txt
Last active March 16, 2021 07:24
Change Service Fabric Cluster Directory Location
1. Open powershell as admin and cd to "C:\Program Files\Microsoft SDKs\Service Fabric\ClusterSetup"
2. Run command: ".\DevClusterSetup.ps1 -PathToClusterDataRoot D:\SFDevCluster -PathToClusterLogRoot D:\SFDevCluster -CreateOneNodeCluster".
Change the parameter path in "-PathToClusterLogRoot" and "-PathToClusterDataRoot" to desired directory.
Remove "-CreateOneNodeCluster" argument to setup 5 nodes.
3. Open Service Fabric Local Cluster Manager in "C:\Program Files\Microsoft SDKs\Service Fabric\Tools\ServiceFabricLocalClusterManager\ServiceFabricLocalClusterManager.exe"
**NOTE:**
Reset local cluster by running the command in Step 2 and not in Service Fabric Local Cluster Manager because it will create the local cluster in default drive which is C drive.
@kggayo
kggayo / text-decoration_underline.css
Created June 23, 2017 04:19
Vertical spacing in text-decoration: underline using CSS
/*
Adjust vertical space by adjusting 71%
Adjust line thickness by adjusting 71% and 72%
*/
a:hover {
background: -moz-linear-gradient(top, rgba(0,0,0,0) 0%, rgba(0,0,0,0) 71%, #FFFFFF 71.1%, #FFFFFF 72%, rgba(0,0,0,0) 72.1%, rgba(0,0,0,0) 100%); /* FF3.6+ */
background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,rgba(0,0,0,0)), color-stop(71%,rgba(0,0,0,0)), color-stop(71.1%,#FFFFFF), color-stop(72%,#FFFFFF), color-stop(72.1%,rgba(0,0,0,0)), color-stop(100%,rgba(0,0,0,0))); /* Chrome,Safari4+ */
background: -webkit-linear-gradient(top, rgba(0,0,0,0) 0%,rgba(0,0,0,0) 71%,#FFFFFF 71.1%,#FFFFFF 72%,rgba(0,0,0,0) 72.1%,rgba(0,0,0,0) 100%); /* Chrome10+,Safari5.1+ */
background: -o-linear-gradient(top, rgba(0,0,0,0) 0%,rgba(0,0,0,0) 71%,#FFFFFF 71.1%,#FFFFFF 72%,rgba(0,0,0,0) 72.1%,rgba(0,0,0,0) 100%); /* Opera 11.10+ */
background: -ms-linear-gradient(top, rgba(0,0,0,0) 0%,rgba(0,0,0,0) 71%,#FFFFFF 71.1%,#FFFFFF 72%,rgba(0,0,0,0) 72.1%,rgba(0,0,0,0) 100%); /* IE10+ */
@kggayo
kggayo / flatten_array.cs
Last active October 12, 2017 05:59
C#: Flatten an array of arbitrarily nested arrays into a flat array.
/// <summary>
/// This program will flatten an array of arbitrarily nested arrays of integers into a flat array of integers. e.g. [[1,2,[3]],4] -> [1,2,3,4].
/// It will accept type in nested arrays and specify what type to return in a flatten array format.
/// </summary>
/// <param name="args"></param>
static void Main(string[] args)
{
//create an array of arbitrarily nested arrays
object[] nestedArrays = new object[] { 1,2,3,4, new Int32[]{2,3,4,5}, new object[]{ 6,7,8, new object[]{9,10,11}}, "A", "B", "C"};