Skip to content

Instantly share code, notes, and snippets.


Olly Hodgson OllyHodgson

View GitHub Profile
mikowl / oneliners.js
Last active Mar 17, 2021
👑 Awesome one-liners you might find useful while coding.
View oneliners.js
// By @coderitual
// Remove any duplicates from an array of primitives.
const unique = [ Set(arr)]
// Sleep in async functions. Use: await sleep(2000).
const sleep = (ms) => (new Promise(resolve => setTimeout(resolve, ms)));
// or
const sleep = util.promisify(setTimeout);
donker / Login.ascx
Created Mar 7, 2019
Login screen skin page for DNN
View Login.ascx
<%@ Control language="VB" AutoEventWireup="false" Explicit="True" Inherits="DotNetNuke.UI.Skins.Skin" %><%@ Register TagPrefix="connect" Namespace="Connect.DNN.Modules.SkinControls" Assembly="Connect.DNN.Modules.SkinControls" %><%@ Register TagPrefix="dnn" Namespace="DotNetNuke.Web.Client.ClientResourceManagement" Assembly="DotNetNuke.Web.Client" %><%@ Register TagPrefix="dnn" TagName="MENU" Src="~/DesktopModules/DDRMenu/Menu.ascx" %>
<%@ Register TagPrefix="dnn" TagName="PRIVACY" Src="~/Admin/Skins/Privacy.ascx" %>
<%@ Register TagPrefix="dnn" TagName="TERMS" Src="~/Admin/Skins/Terms.ascx" %>
<dnn:DnnCssInclude runat="server" FilePath="css/bootstrap.min.css" PathNameAlias="SkinPath" />
<dnn:DnnCssInclude runat="server" FilePath="css/font-awesome.min.css" PathNameAlias="SkinPath" />
<dnn:DnnCssInclude runat="server" FilePath="css/sb-admin-2.min.css" PathNameAlias="SkinPath" />
<dnn:DnnCssInclude runat="server" FilePath="dnndefault/8.0.0/default.css" PathNameAlias="SharedScripts" Name="dnndefault" Version="8.0
sibelius /
Created Nov 10, 2017
How to easily type Redux Props with Flow

How to easily type Redux Props with Flow

Add ExtractReturn helper

// eslint-disable-next-line no-unused-vars
type _ExtractReturn<B, F: (...args: any[]) => B> = B;
export type ExtractReturn<F> = _ExtractReturn<*, F>;

Advanced JavaScript Learning Resources

This is a list of advanced JavaScript learning resources from people who responded to this [Tweet][13] and this [Tweet][20].

  • [You Don't Know JS][3]

  • [Frontend Masters courses by Kyle Simpson][12]

  • [@mpjme][6]'s [YouTube videos][5]

ech01 / DnnScheduleExample.cs
Last active May 25, 2021
DNN Scheduler Example
View DnnScheduleExample.cs
using System;
using System.Data;
using System.Data.Sql;
using System.Data.SqlClient;
using System.Configuration;
using DotNetNuke.Services.Mail;
using DotNetNuke.Entities.Portals;
using DotNetNuke.Common.Utilities;
using DotNetNuke.Entities.Portals;
WebReflection / gist:24c4c475bdeb59405e87
Last active Feb 15, 2016
setTimeout and setInterval extra arguments
View gist:24c4c475bdeb59405e87

Every single JavaScript engine supports standard timers *

These accept one or more extra argument by specs

for(var i = 0; i < 2; i++) {
  setTimeout(function (i) {
  }, 0, i); // <== see this?
krisbulman / countCSSRules.js
Last active Feb 6, 2019 — forked from psebborn/countCSSRules.js
Count the number of rules and selectors for CSS files on the page. Flags up the >4096 threshold that confuses IE. — This snippet has been modified to count more than just the first level of CSSStyleRule objects within CSSMediaRule.
View countCSSRules.js
function countCSSRules() {
var results = '',
log = '';
if (!document.styleSheets) {
for (var i = 0; i < document.styleSheets.length; i++) {
function countSheet(sheet) {
codler / flex.less
Last active Nov 20, 2020
Prefix flex for IE10 and Safari / iOS in LESS
View flex.less
/*! Prefix flex for IE10 and Safari / iOS in LESS
* Copyright (c) 2014 Han Lin Yap; MIT license */
.display(@value) when (@value = flex) {
display: -ms-flexbox; // IE10
display: -webkit-flex; // Safari / iOS
.display(@value) when (@value = inline-flex) {
paulrouget /
Last active Mar 11, 2019 — forked from operatorjen/
Hacking Firefox
lttlrck / gist:9628955
Created Mar 18, 2014
rename git branch locally and remotely
View gist:9628955
git branch -m old_branch new_branch # Rename branch locally
git push origin :old_branch # Delete the old branch
git push --set-upstream origin new_branch # Push the new branch, set local branch to track the new remote