Skip to content

Instantly share code, notes, and snippets.

{
"$schema": "https://raw.githubusercontent.com/JanDeDobbeleer/oh-my-posh/main/themes/schema.json",
"blocks": [
{
"alignment": "left",
"segments": [
{
"type": "path",
"background": "#ff479c",
"foreground": "#ffffff",
@simoncowie
simoncowie / callback-mock.js
Created June 28, 2018 03:20
Mock-server callback example in node
var mockserver = require('mockserver-node');
var mockServerClient = require('mockserver-client').mockServerClient;
var mockserver_port = 1234;
mockserver
.start_mockserver({ serverPort: mockserver_port, verbose: true })
.then(
function () {
mockServerClient("localhost", mockserver_port).mockWithCallback(
@simoncowie
simoncowie / Docker & localhost
Last active March 5, 2018 00:50
Docker bits and pieces
# Access to localhost through docker.for.win.localhost
# A hack to hit that IP as localhost
# note that ip may change so could be fragile?
docker run --add-host localhost:192.168.65.2 ... etc
#dynamically as part of dockerfile
#Ugly but working for local stuff.
ENTRYPOINT echo "$(dig +short docker.for.win.host.internal) localhost" >> /etc/hosts && exec python ./end2end_dev.py
@simoncowie
simoncowie / rebasewithoutrebase.txt
Last active February 20, 2017 20:58
Git rebase without the rebase
git reset --soft HEAD~4 &&
git commit --edit -m"$(git log --format=%B --reverse HEAD..HEAD@{1})"
@simoncowie
simoncowie / SaveBinaryDataAsFile.linq
Last active March 11, 2024 10:07
Example: Simple way to save and fetch binary data to/from files using linqpad
//Set Language to "C# Program" in linqPad
void Main()
{
var peopleWithPics = TblPersons
.Where(p => p.ProfilePicture != null)
.Select(p => new { p.PersonID, p.ProfilePicture });
foreach(var p in peopleWithPics)
{
@simoncowie
simoncowie / spCreate.sql
Created August 15, 2016 22:33
Create stored proc - ms sql
USE DB
GO
CREATE PROCEDURE dbo.spMySpName
@param1 int,
@param2 int,
@paramWithDefault nvarchar(20) = null
AS
BEGIN
DECLARE @someVar nvarchar(100);
@simoncowie
simoncowie / Sitefinity Feather PageTitle widget.md
Created May 29, 2015 04:11
Sitefinity Feather widget for auto Page Titles

#Sitefinity Feather PageTitle widget

Sitefinity Feather widget for auto Page Titles.

TODO:

  • I'll update it at some point to make the enclosing tag configurable.
@simoncowie
simoncowie / Sitefinity - Fixed Header in edit mode.md
Last active August 29, 2015 14:22
Sitefinity - Simple change to fix your fixed nav bars from breaking the page editor

#Sitefinity - Fixed Header in edit mode

This is a simple change to stop your fixed nav bars from breaking the page editor.