Skip to content

Instantly share code, notes, and snippets.

View juanka881's full-sized avatar
🌴
On vacation

Juanka juanka881

🌴
On vacation
  • company of one
  • houston tx
View GitHub Profile
@juanka881
juanka881 / tsclean.js
Created January 14, 2021 06:38
clean up ts output that does not match input in source dirs
const fse = require('fs-extra');
const path = require('path');
const _ = require('lodash');
const shelljs = require('shelljs');
async function getFiles(dir) {
let results = [];
const files = await fse.readdir(dir);
for(const file of files) {
@juanka881
juanka881 / getec2ip
Last active November 18, 2019 02:28
const ps = require('child_process');
function curl(url) {
const output = ps.execSync(`curl -s ${url}`).toString('utf8').trim();
return output;
}
function getJson(url) {
const output = curl(url);
const json = JSON.parse(output);
<Import Project="..\Common.props" />
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<SolutionDir>$(MSBuildThisFileDirectory)</SolutionDir>
<Configuration Condition="$(Configuration) == ''">Debug</Configuration>
<OutputPath>$(SolutionDir)\build\bin\$(Configuration)\</OutputPath>
<OutDir>$(OutputPath)</OutDir>
<IntermediateOutputPath>$(SolutionDir)\build\obj\$(Configuration)\$(MSBuildProjectName)\</IntermediateOutputPath>
<UseCommonOutputDirectory>false</UseCommonOutputDirectory>
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
public static class CombGuid
{
public static readonly DateTime BaseDate = new DateTime(1900, 1, 1);
public static Guid New
{
get
{
var guidBytes = Guid.NewGuid().ToByteArray();
var now = DateTime.UtcNow;
@juanka881
juanka881 / vsCodeOpenFolder.reg
Last active August 3, 2016 16:30
adds right click context menu actions for vscode on files and dirs after having installed vscode without the right click context menu options.
Windows Registry Editor Version 5.00
; copied from http://thisdavej.com/right-click-on-windows-folder-and-open-with-visual-studio-code/
; Open files
[HKEY_CLASSES_ROOT\*\shell\Open with VS Code]
@="Edit with VS Code"
"Icon"="C:\\Program Files (x86)\\Microsoft VS Code\\Code.exe,0"
[HKEY_CLASSES_ROOT\*\shell\Open with VS Code\command]
@="\"C:\\Program Files (x86)\\Microsoft VS Code\\Code.exe\" \"%1\""
; This will make it appear when you right click ON a folder
function fuzzyMatch(searchSet, query) {
var tokens = query.toLowerCase().split(''),
matches = [];
searchSet.forEach(function(string) {
var tokenIndex = 0,
stringIndex = 0,
matchWithHighlights = '',
matchedPositions = [];
@juanka881
juanka881 / gist:2a007fac98383b099123
Created August 13, 2014 22:03
howto override nancyfx internal with custom implementation - change IRouteDescriptionProvider with a custom one
public class CustomRouteDescProvider : IRouteDescriptionProvider
{
public string GetDescription(INancyModule module, string path)
{
return string.Empty;
}
}
// override internal config prop on bootstrapper, and provide the custom type, gg
public class Boottrapper : Nancy.DefaultNancyBootstrapper
@juanka881
juanka881 / datagridstyle.xaml
Created May 1, 2013 04:48
datagrid styling
<Style TargetType="DataGrid">
<Setter Property="Background" Value="White" />
<!-- Make the border and grid lines a little less imposing -->
<Setter Property="BorderBrush" Value="#DDDDDD" />
<Setter Property="HorizontalGridLinesBrush" Value="#DDDDDD" />
<Setter Property="VerticalGridLinesBrush" Value="#DDDDDD" />
<Setter Property="RowStyle">