Skip to content

Instantly share code, notes, and snippets.

@jon-kim
jon-kim / CreateEmployeeTimetable_Pivot_Dynamic.SQL
Last active May 30, 2020
Pivot with Dynamic column values
View CreateEmployeeTimetable_Pivot_Dynamic.SQL
CREATE TABLE #DATA (
name VARCHAR(50),
shift_start DATETIME,
shift_end DATETIME
)
INSERT INTO #DATA VALUES ('Boony Antonchik', '2017-05-30 14:00', '2017-05-30 17:00')
INSERT INTO #DATA VALUES ('Toma Wittier', '2017-05-30 14:00', '2017-05-30 15:00')
INSERT INTO #DATA VALUES ('Genvieve Arends', '2017-05-30 8:00', '2017-05-30 13:00')
INSERT INTO #DATA VALUES ('Ulla Friatt', '2017-05-30 18:00', '2017-05-30 19:00')
INSERT INTO #DATA VALUES ('Giralda Ranfield', '2017-05-30 13:00', '2017-05-30 15:00')
View data.csv
soundcloud different_url
https://api.soundcloud.com/tracks/910291 https://api.different-embed.com/12345
https://api.soundcloud.com/tracks/5678 https://api.different-embed.com/562222278
https://api.soundcloud.com/tracks/12345 https://api.different-embed.com/89999999
View ExtensionMethods_XamlClone.cs
public static class ExtensionMethods
{
public static T XamlClone<T>(this T original) where T : class
{
if (original == null)
return null;
object clone;
using (var stream = new MemoryStream())
{
XamlWriter.Save(original, stream);
@jon-kim
jon-kim / CreateEmployeeTimetable_Pivot.SQL
Last active Jun 6, 2017
Create Employee Timetable with PIVOT in SQL Server
View CreateEmployeeTimetable_Pivot.SQL
CREATE TABLE #DATA (
name VARCHAR(50),
shift_start DATETIME,
shift_end DATETIME
)
INSERT INTO #DATA VALUES ('Boony Antonchik', '2017-05-30 14:00', '2017-05-30 17:00')
INSERT INTO #DATA VALUES ('Toma Wittier', '2017-05-30 14:00', '2017-05-30 15:00')
INSERT INTO #DATA VALUES ('Genvieve Arends', '2017-05-30 8:00', '2017-05-30 13:00')
INSERT INTO #DATA VALUES ('Ulla Friatt', '2017-05-30 18:00', '2017-05-30 19:00')
@jon-kim
jon-kim / autoCompleteLngLatGoogleMapApi.html
Last active Jun 6, 2017
Auto Complete Location and Get Longitude and Latitude using Google Map API
View autoCompleteLngLatGoogleMapApi.html
<!DOCTYPE html>
<html>
<head>
<script src="https://maps.googleapis.com/maps/api/js?v=3.exp&sensor=false&libraries=places"></script>
</head>
<body>
<label for="locationTextField">Location</label>
<input id="locationTextField" type="text" size="50">
<div id="output" />
<script>
@jon-kim
jon-kim / autoCompleteGoogleMapApi.html
Last active Aug 2, 2020
Auto Complete Location using Google Map API
View autoCompleteGoogleMapApi.html
<!DOCTYPE html>
<html>
<head>
<script src="https://maps.googleapis.com/maps/api/js?v=3.exp&sensor=false&libraries=places"></script>
</head>
<body>
<label for="locationTextField">Location</label>
<input id="locationTextField" type="text" size="50">
<script>
You can’t perform that action at this time.