Skip to content

Instantly share code, notes, and snippets.

View rikdc's full-sized avatar
🏠
Working from home

Richard Claydon rikdc

🏠
Working from home
View GitHub Profile
@rikdc
rikdc / docker-compose.yaml
Created August 25, 2022 20:41
jekyll docker-compose
version: "3"
services:
jekyll:
image: jekyll/jekyll:latest
command: jekyll serve --watch --force_polling
ports:
- 4000:4000
volumes:
- .:/srv/jekyll
@rikdc
rikdc / gmail-github-filters.md
Created May 12, 2022 13:38 — forked from ldez/gmail-github-filters.md
Gmail and GitHub - Filters

Gmail and GitHub

Create new filters and create new labels.

Pull Request

label: gh-pull-request

@rikdc
rikdc / gist:265ec40ff321ea80f730
Created May 6, 2015 17:47
Codility - FrogJump
using System;
class Solution {
public int solution(int X, int Y, int D) {
var distance = (double)(Y - X);
return Math.Ceiling(distance / (double)D);
}
}
[{"id":"1","name":"Page Type 1","created":"2010-04-25 15:06:13","updated":"2010-04-25 15:06:13"},
{"id":"2","name":"Page Type 2","created":"2010-04-25 15:06:13","updated":"2010-04-25 15:06:13"}]
@rikdc
rikdc / sql-inserts.sql
Created October 12, 2012 11:31
Batch insert example
SET STATISTICS TIME ON;
GO
INSERT INTO dbo.AnonymousNames
( id, firstname, lastname )
VALUES ( 1, -- id - int
N'John', -- firstname - nvarchar(50)
N'Doe' -- lastname - nvarchar(50)
)
GO
@rikdc
rikdc / csv-example.sql
Created October 12, 2012 11:27
CSV SQL Statement
INSERT INTO table (col1, col2)
VALUES
(1, 'Record 1'),
(2, 'Record 2');
@rikdc
rikdc / slow-bulk-insert.sql
Created October 12, 2012 11:13
Insert multiple records, the slow way:
USE SomeDatabase
GO
INSERT INTO SomeTable (Col1, Col2, Col3) VALUES (1, 'John', 'Doe');
INSERT INTO SomeTable (Col1, Col2, Col3) VALUES (2, 'Jane', 'Doe');
INSERT INTO SomeTable (Col1, Col2, Col3) VALUES (3, 'Jean', 'Dupont');
INSERT INTO SomeTable (Col1, Col2, Col3) VALUES (4, 'Kwasi', 'Mensa');
GO