Skip to content

Instantly share code, notes, and snippets.

View CliffCrerar's full-sized avatar
😎
There is a time to code, and a time to code.

C1I7F05D-C53545 CliffCrerar

😎
There is a time to code, and a time to code.
View GitHub Profile
@CliffCrerar
CliffCrerar / seo-checklist.html
Created November 13, 2019 01:55
Check list page with seo tags
<!DOCTYPE html>
<html>
<head>
<title>This is the title of my page</title>
<meta name="description" content="type_your_description_here">
<!-- FB OG API -->
<meta property="fb:app_id" content="1234567890" />
<meta property="og:type" content="article" />
<meta property="og:url" content="http://newsblog.org/news/136756249803614" />
function changeDateFormat(dates) {
// Write the code that goes here
const regExp = /^\d{2,4}(\/|-)\d{2}(\/|-)\d{2,4}$/
const regExpG = /(-|\/)/
const newArr = [];
for (let i = 0; i < dates.length; i++) {
if(dates[i].match(regExp)===null){
break;
} else if (dates[i].match(regExp).length > 0) {
newArr.push(
@CliffCrerar
CliffCrerar / js-async-patterns.js
Last active March 25, 2020 08:02
Javascript async patterns
/*****************************************************************************
< How do you delay functions in JavaScript. />
3 Methods:
1. Callback
2. Promise
3. Observable
With Javascript there are always creative ways to do almost any kind of
@CliffCrerar
CliffCrerar / gcreate.sh
Created September 29, 2019 01:58
Create gh repo from the bash command line
#Usage: gcreate userName repoName "Description if any"
gcreate () {
curl -u $1 https://api.github.com/user/repos -d "{\"name\": \"$2\", \"description\": \"$3\"}"
}
@CliffCrerar
CliffCrerar / ph_za_2019.json
Created September 27, 2019 10:55
ph_za_2019.json
{
"meta": {
"code": 200
},
"response": {
"holidays": [
{
"name": "New Year's Day",
"description": "New Year’s Day is celebrated with a blend of both diversity and tradition in countries such as South Africa on January 1 each year.",
"date": {
@CliffCrerar
CliffCrerar / ts-reminders.json
Last active October 2, 2019 08:55
Reminders
[
{
"PartitionKey": 1234,
"RowKey": "f13a546c-f7f2-44d6-8da7-9b0c1ee1327f",
"Timestamp": "2019-09-20T12:31:24.157Z",
"eventSettingID": "3eb38234-726c-4b22-948b-870cba0433d8",
"reminderSettingID": "9cb43439-1800-4b82-8c2f-1e1c41b42fae",
"eventName": "Mind remind",
"triggerDate": "2019/10/21",
"triggerCriteria": 0,
@CliffCrerar
CliffCrerar / sp_KillSessionByDbName.sql
Last active September 24, 2019 12:07
SQL Server kill sessions by database name
CREATE PROCEDURE [dbo].[sp_KillSessionByDbName]
@dbname sysname = ''
AS
BEGIN
-- check the input database name
IF DATALENGTH(@dbname) = 0 OR LOWER(@dbname) = 'master' OR LOWER(@dbname) = 'msdb'
RETURN
DECLARE @sql VARCHAR(30)
var email{
content: '/^(([^<>()[\]\\.,;:\s@\']+(\.[^<>()[\]\\.,;:\s@\']+)*)|(\'.+\'))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/';
}
@CliffCrerar
CliffCrerar / ts-events.json
Last active October 1, 2019 12:11
ts-events
[
{
"eventName": "End-Month Review",
"cardID": "2a48c4e4-cc10-4113-ab3e-1410f542412b",
"createdBy": "[email protected]",
"companyID": "69L5PBdCc0KAlp2RdgwcfA",
"companyName": "Jason Test Company Pty (Ltd)",
"countryCode": "ZA",
"countryName": "South Africa",
"taxType": "Type 3",
@CliffCrerar
CliffCrerar / PhoneBookDemo.md
Created September 8, 2019 16:24
phonebookDemo-data-gist

This gist contains the files for the demo app PhoneBookDemo