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 / 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 / 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 / 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 / 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
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 / 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" />
@CliffCrerar
CliffCrerar / list-of-vscode-fav-ext.json
Last active January 1, 2020 04:51
A list of my bare min and most useful extensions
[
"whtouche.vscode-js-console-utils",
"steoates.autoimport",
"mrmlnc.vscode-autoprefixer",
"streetsidesoftware.code-spell-checker",
"lenconda.theme-darkplusplusplus",
"usernamehw.errorlens",
"eamodio.gitlens",
"christian-kohler.path-intellisense",
"christian-kohler.npm-intellisense",
@CliffCrerar
CliffCrerar / declare-temp-table-example.sql
Last active April 3, 2020 20:20
Temporary tables in SQL and how they behave
/* BEGIN FILE (transaction) */
-- SYMANTICS:
-- In the context of SQL there is an idea of a table veriable and a temporary
table. A table variable has a table structure and is more maluable than a
temp table but it is less persistent than a temp table.
create table #OneRowOneLine (num int) -- declare the temp table
{
"command": "SELECT",
"rowCount": 35,
"oid": null,
"rows": [
{
"propertyid": 1,
"estateid": 4,
"estatename": "habitibility",
"addressid": 42,
:root {
--blue: #007bff;
--indigo: #6610f2;
--purple: #6f42c1;
--pink: #e83e8c;
--red: #dc3545;
--orange: #fd7e14;
--yellow: #ffc107;
--green: #28a745;
--teal: #20c997;