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
name: CI - Update COVID-19 Data | |
on: | |
schedule: | |
- cron: '0 8 * * *' | |
jobs: | |
build: | |
runs-on: ubuntu-latest |
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
/** | |
HOW TO USE | |
Add the minified line of javascript to your .upptimerc.yml configuration file, so that it looks like this: | |
status-website: | |
js: "class SearchBar { searchInput = null; constructor() { window.addEventListener('load', this.init.bind(this)); } init() { this.setupElements(); this.addEventListeners(); } setupElements() { this.searchInput = this.createSearchBar(); this.updateSites(); } updateSites() { this.sites = document.querySelectorAll('section.live-status article.link'); } addEventListeners() { this.searchInput.addEventListener( 'input', this.handleSearchInputChange.bind(this) ); } handleSearchInputChange(e) { this.updateSites(); const value = e.target.value; this.sites.forEach((siteEl) => { let match = false; const headingEl = siteEl.querySelector('h4 a'); const heading = headingEl.innerHTML; const href = headingEl.getAttribute('href'); if (!value) { match = true; } else { if (heading.toLowerCase().includes(value.toLowerCase())) { match = true; } else if ( href && href.toLowerCase().includes |
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
// Sass | |
.skeleton { | |
display: inline-block; | |
height: 1em; | |
position: relative; | |
overflow: hidden; | |
background-color: #dddbdd; | |
&::after { | |
position: absolute; |
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
<!-- In PHP --> | |
<iframe | |
src=" | |
<?php | |
$search_terms = rawurlencode("3 Abbey Road, London, GB NW8 9AY"); | |
$src = | |
"https://www.google.com/maps?q=2880%20" . | |
$search_terms . | |
"&t=&z=15&ie=UTF8&iwloc=&output=embed"; | |
echo $src; |
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
<?php | |
function my_theme_add_setting_control($wp_customize, $color, $options) | |
{ | |
$key = $color[0]; | |
$label = $color[1]; | |
$default_hex = $color[2]; | |
$section = $options['section']; |
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
-- Source: https://ainab.site/2021/12/08/create-an-azure-sql-server-login-and-connect-a-user-to-it/ | |
-- Execute this query in the "master" database | |
-- Create new login | |
CREATE LOGIN [new-login] | |
WITH PASSWORD = 'complex-password' | |
GO | |
-- Execute these queries in the target database |
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
// Source: https://ainab.site/2021/12/09/test-multiple-sql-server-connection-strings-in-a-dotnet-console-app/ | |
using System.Data.SqlClient; | |
class Credentials | |
{ | |
public string Username { get; set; } | |
public string Password { get; set; } | |
public string Server { get; set; } | |
public Credentials(string username, string password, string server = "sql-server.example.com") { | |
Username = username; |
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
<?php | |
if (defined('GOOGLE_ANALYTICS_KEY')) { | |
?> | |
<!-- Global site tag (gtag.js) - Google Analytics --> | |
<script async src="https://www.googletagmanager.com/gtag/js?id=<?php echo GOOGLE_ANALYTICS_KEY; ?>"></script> | |
<script> | |
window.dataLayer = window.dataLayer || []; | |
function gtag() { | |
dataLayer.push(arguments); |
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
Solidity lets you program on Ethereum, a blockchain-based virtual machine that allows the creation and execution of smart contracts, without needing centralized or trusted parties. | |
Solidity is a statically typed, contract programming language that has similarities to Javascript and C. Like objects in OOP, each contract contains state variables, functions, and common data types. Contract-specific features include modifier (guard) clauses, event notifiers for listeners, and custom global variables. | |
Some Ethereum contract examples include crowdfunding, voting, and blind auctions. | |
As Solidity and Ethereum are under active development, experimental or beta features are explicitly marked, and subject to change. Pull requests welcome. | |
// First, a simple Bank contract | |
// Allows deposits, withdrawals, and balance checks | |
// simple_bank.sol (note .sol extension) | |
/* **** START EXAMPLE **** */ |
OlderNewer