A Pen by Envato Tuts+ on CodePen.
This file contains hidden or 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
| Given the XML down below, we can use a couple of queries to get individual elements (or attr) but also a list of other nodes/values: | |
| ;with cte | |
| as | |
| ( | |
| select | |
| Id, | |
| Filename, |
This file contains hidden or 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 Function DecodeXml(TextToDecode As String) As String | |
| 'Take text that has been encoded for XML and change it to normal text | |
| Dim Res As String | |
| Res = Replace(Replace(Replace(Replace(TextToDecode, """, """"), ">", ">"), "<", "<"), "&", "&") | |
| DecodeXml = Res | |
| End Function |
This file contains hidden or 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
| SELECT DATEDIFF(SECOND,'1970-01-01', GETUTCDATE()) AS 'UnixEpochTimestamp'; |
This file contains hidden or 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
| SELECT DATABASEPROPERTYEX (N'SQL-Examples', N'STATUS') AS N'Status'; | |
| ALTER DATABASE [SQL-Examples] SET EMERGENCY; | |
| GO | |
| ALTER DATABASE [SQL-Examples] SET SINGLE_USER; | |
| GO | |
| DBCC CHECKDB (N'SQL-Examples', REPAIR_ALLOW_DATA_LOSS) WITH NO_INFOMSGS, ALL_ERRORMSGS; | |
| GO | |
| -- Remember to set back to multi-user |
This file contains hidden or 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
| const frame = new Frame("fit", 800, 600, "#EEE", "#555"); | |
| frame.on("ready", ()=>{ | |
| zog("ready from ZIM Frame"); // logs in console (F12 - choose console) | |
| // often need below - so consider it part of the template | |
| const stage = frame.stage; | |
| const stageW = frame.width; | |
| const stageH = frame.height; | |
| // REFERENCES for ZIM at https://zimjs.com |
This file contains hidden or 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
| function jslive(eventType, elementId, cb) { | |
| document.addEventListener(eventType, function (event) { | |
| if (event.target.id === elementId) { | |
| cb.call(event.target, event); | |
| } | |
| }); | |
| } | |
| // Params are: event type (click, mouseover etc), element to look for (id or class etc), callback function | |
| jslive("click", ".my-class", function (event) { |
This file contains hidden or 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
| CREATE PROCEDURE [dbo].[sp_add_image_to_SQL] | |
| @ImageId int, | |
| @ImageFilePath nvarchar(255) | |
| AS | |
| BEGIN | |
| SET NOCOUNT ON; | |
| DECLARE @sql_string nvarchar(max) = |
This file contains hidden or 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
| /* | |
| Replace "getdate()" with whatever date you need i.e. a field | |
| */ | |
| select convert(nvarchar(17),getdate(),127)+'00.00Z' as myISOdate |
This file contains hidden or 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
| <!DOCTYPE html> | |
| <!--[if lt IE 7]> <html class="no-js lt-ie9 lt-ie8 lt-ie7"> <![endif]--> | |
| <!--[if IE 7]> <html class="no-js lt-ie9 lt-ie8"> <![endif]--> | |
| <!--[if IE 8]> <html class="no-js lt-ie9"> <![endif]--> | |
| <!--[if gt IE 8]><!--> | |
| <html class="no-js"> | |
| <!--<![endif]--> | |
| <head> | |
| <meta charset="utf-8"> |
NewerOlder