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
| # Install prerequisites. | |
| sudo apt-get install -y build-essential \ | |
| libreadline6 libreadline6-dev \ | |
| gfortran \ | |
| libxorg-dev \ | |
| libbz2-dev \ | |
| liblzma-dev \ | |
| libpcre3-dev \ | |
| libcurl4-openssl-dev \ | |
| libjpeg-dev libtiff5-dev libicu-dev libcairo2-dev \ |
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
| EXEC sp_configure 'Ole Automation Procedures', 1; | |
| GO | |
| RECONFIGURE; | |
| GO |
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 function [dbo].[DecryptString] | |
| ( | |
| @xml xml | |
| ) | |
| returns varchar(max) | |
| as | |
| begin | |
| declare @returnString varchar(max); | |
| declare @temp table (line int, encryptedText varbinary(max), plainText varchar(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
| using System; | |
| using System.Net; | |
| using System.Net.Security; | |
| using System.Security.Cryptography.X509Certificates; | |
| namespace ServerCertificateValidationDemo | |
| { | |
| public class Program | |
| { | |
| private static string _defaultUrl = @"https://www.google.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
| /* | |
| fn_FilenameFromFullPath.sql (c) 2017 Jarrett Meyer | |
| Description: | |
| Extracts a filename from a full path. Files may have spaces. | |
| Examples: | |
| dbo.fn_FilenameFromFullPath('file.txt') -> 'file.txt' | |
| dbo.fn_FilenameFromFullPath('C:\file.txt') -> 'file.txt' | |
| dbo.fn_FilenameFromFullPath('C:\temp\examples\file.txt') -> 'file.txt' |
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
| -- Drop the ref.dates table if it already exists. | |
| IF OBJECT_ID('ref.dates') IS NOT NULL DROP TABLE ref.dates; | |
| GO | |
| -- Create a temp table with computed values. We will delete this | |
| -- temp table at the end of this script. | |
| CREATE TABLE #dates ( | |
| date DATE NOT NULL, | |
| year AS DATEPART(YEAR, date), |
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
| // Define our constants | |
| const width = 600; | |
| const height = 400; | |
| const borderWidth = 10; | |
| const ballRadius = 10; | |
| const drawInterval = 1; | |
| const speedMultiplier = 1; | |
| // Define the SVG "canvas". This is where we will create our drawing. | |
| let svg = d3.select("#tabletop") |
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
| // Define constants. | |
| const width = 800; | |
| const height = 500; | |
| const padding = { top: 20, bottom: 20, left: 20, right: 20 }; | |
| // Define our SVG canvas. | |
| let svg = d3.select("svg"); | |
| let width = +svg.attr("width") - padding.left - padding.right; | |
| let height = +svg.attr("height") - padding.top - padding.bottom; |
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
| # Import libraries. You don't really need tidyverse, I just like working with tibbles. | |
| library(RPostgreSQL) | |
| library(tidyverse) | |
| record_count = 1000 | |
| min_date = "2015-01-01" | |
| max_date = "2018-12-31" | |
| actions = c("Button click", "Fetch data", "Page load", "Refresh") | |
| users = c("Allen", "Brian", "Charlie", "Dave", "Evan") |
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
| // Get the parameters after the question mark. | |
| let search = new URLSearchParams(window.location.search); | |
| // Get the token and make sure it matches. | |
| let token = search.get("token"); | |
| if (token !== "hello-world") { | |
| // The token did not match what we expected. Get rid of everything out of the body and stop the program. | |
| let body = document.getElementsByTagName("body")[0]; | |
| body.style.backgroundColor = "black"; | |
| body.innerHTML = '<p style="color: darkred;font-size: 36px;margin: 16px;">Forbidden!</p>'; |