This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--from SO: http://stackoverflow.com/questions/5873170/generate-class-from-database-table | |
declare @TableName sysname = 'TableName' | |
declare @Result varchar(max) = 'public class ' + @TableName + ' | |
{' | |
select @Result = @Result + ' | |
public ' + ColumnType + NullableSign + ' ' + ColumnName + ' { get; set; } | |
' | |
from |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<style> | |
.strike { | |
display: block; | |
text-align: center; | |
overflow: hidden; | |
white-space: nowrap; | |
} | |
.strike > span { | |
position: relative; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Returns the week number for this date. dowOffset is the day of week the week | |
* "starts" on for your locale - it can be from 0 to 6. If dowOffset is 1 (Monday), | |
* the week returned is the ISO 8601 week number. | |
* @param int dowOffset | |
* @return int | |
*/ | |
Date.prototype.getWeek = function (dowOffset) { | |
/*getWeek() was developed by Nick Baicoianu at MeanFreePath: http://www.meanfreepath.com */ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// JS array equivalents to C# LINQ methods - by Dan B. | |
// Here's a simple array of "person" objects | |
var people = [ | |
{ name: "John", age: 20 }, | |
{ name: "Mary", age: 35 }, | |
{ name: "Arthur", age: 78 }, | |
{ name: "Mike", age: 27 }, | |
{ name: "Judy", age: 42 }, | |
{ name: "Tim", age: 8 } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Refrence from: https://gist.github.com/beevelop/a0f2c76e79610dca01550c9a93f83876 | |
// Copy following scripts in the developer console of page included markdown content you want to print: | |
(function () { | |
var $ = document.querySelector.bind(document); | |
$('#readme').setAttribute('style', 'position:absolute;top:0;left:0;right:0;bottom:0;z-index:100;background-color:white'); | |
$('#readme>article').setAttribute('style', 'border: none'); | |
$('body').innerHTML = $('#readme').outerHTML; | |
window.print(); | |
})(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# This file has been written to your home directory for convenience. It is | |
# saved as "/home/pi/temperature-2017-10-12-13-53-36.py" | |
import time | |
import threading | |
import csv | |
import datetime | |
from sense_emu import SenseHat | |
brake = 1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public static void Main(string[] args) | |
{ | |
List<Result> result = MakeRequest().Result; | |
SendMessage(result); | |
Console.Read(); | |
} | |
public static async void SendMessage(List<Result> result) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public static void CreateTestMessage4 ( string server ) | |
{ | |
MailAddress from = new MailAddress( "senderemail" ); | |
MailAddress to = new MailAddress( "recipientemail" ); | |
MailMessage message = new MailMessage( from , to ); | |
System.Net.Mail.Attachment attachment = new System.Net.Mail.Attachment( Environment.CurrentDirectory + "/file.pdf" ); | |
var smtp = new SmtpClient |