Skip to content

Instantly share code, notes, and snippets.

Avatar

Krzysztof Koziarski kkoziarski

View GitHub Profile
View yarn_angular_cli.md

To enable Yarn for Angular CLI run the following command:

ng set --global packageManager=yarn

To revert it back to using npm use this:

ng set --global packageManager=npm
@kkoziarski
kkoziarski / Paradox-custom-theme.psm1
Last active Feb 9, 2019
Scripts to run on a new system
View Paradox-custom-theme.psm1
#requires -Version 2 -Modules posh-git
function Write-Theme {
param(
[bool]
$lastCommandFailed,
[string]
$with
)
View fancy.service.spec.ts
import { Injectable } from "@angular/core";
import { TestBed, async, inject } from '@angular/core/testing';
import { HttpModule, Http, Response, ResponseOptions, XHRBackend } from '@angular/http';
import { MockBackend } from '@angular/http/testing';
import { Observable } from 'rxjs/Rx';
@Injectable()
export class FancyService {
protected value = 'real value';
@kkoziarski
kkoziarski / AppBuilderExtensions.cs
Last active Mar 31, 2017 — forked from dschenkelman/Extensions.cs
Intro to OWIN talk and a simple IP filtering middleware sample
View AppBuilderExtensions.cs
namespace Owin.IpFilter
{
using System;
using System.Net;
public static class AppBuilderExtensions
{
public static IAppBuilder UseIpFiltering(this IAppBuilder appBuilder, Func<IPAddress, bool> rejectRequest)
{
appBuilder.Use(typeof(IpFilterMiddleware), rejectRequest);
View FULL-Microsoft.PowerShell_profile.ps1
# Chocolatey profile
$ChocolateyProfile = "$env:ChocolateyInstall\helpers\chocolateyProfile.psm1"
if (Test-Path($ChocolateyProfile)) {
Import-Module "$ChocolateyProfile"
}
function PromptX {
# Print the working directory:
@kkoziarski
kkoziarski / npp_external_editor.config
Created Jan 20, 2017
Notepad++ as external editor
View npp_external_editor.config
EDITOR: "C:\Program Files (x86)\Notepad++\notepad++.exe" -multiInst -notabbar -nosession
VIEWER: "C:\Program Files (x86)\Notepad++\notepad++.exe" -multiInst -notabbar -nosession -ro
@kkoziarski
kkoziarski / doublecmd-monokai-extended-filemask.xml
Last active Jan 19, 2017
Monokai theme for Double Commander. Edit C:\Users\USER\AppData\Roaming\doublecmd\doublecmd.xml and replace <Colors> section
View doublecmd-monokai-extended-filemask.xml
<!--REPLACE <Colors> and <SearchTemplates> -->
<Colors>
<UseCursorBorder>False</UseCursorBorder>
<CursorBorderColor>-2147483635</CursorBorderColor>
<UseFrameCursor>True</UseFrameCursor>
<Foreground>305780</Foreground>
<Background>2238503</Background>
<Background2>2238503</Background2>
<Cursor>16089859</Cursor>
@kkoziarski
kkoziarski / find_table_by_column.sql
Created Jan 18, 2017
Find all tables containing column with specified name
View find_table_by_column.sql
SELECT TABLE_CATALOG, TABLE_SCHEMA, TABLE_NAME, COLUMN_NAME
FROM INFORMATION_SCHEMA.COLUMNS
WHERE COLUMN_NAME like '%Brand%'
ORDER BY TABLE_NAME, COLUMN_NAME
View FSharpSyntax.fsx
// single line comments use a double slash
(* multi line comments use pair
-end of multi line comment- *)
// ======== "Variables" (but not really) ==========
// The "let" keyword defines an (immutable) value
let myInt = 5
let myFloat = 3.14
let myString = "hello" //note that no types needed
View CPPXmasTree.cpp
// CPPXmasTree.cpp : Defines the entry point for the console application.
//
#include "stdafx.h"
#include <iostream>
#include <ostream>
#include <string>
#include "XmasTree.h"
inline void printHelloWorld();