Skip to content

Instantly share code, notes, and snippets.

View OllyHodgson's full-sized avatar

Olly Hodgson OllyHodgson

View GitHub Profile
@char0n
char0n / start.js
Last active May 5, 2022 21:47
Create React App override for start script using rewire library
const path = require('path');
const rewire = require('rewire');
process.chdir(path.join(__dirname, '..'));
const start = rewire('react-scripts/scripts/start.js')
const configFactory = start.__get__('configFactory');
const configFactoryMock = (webpackEnv) => {
const config = configFactory(webpackEnv);
@TheRealFlyingCoder
TheRealFlyingCoder / Cloud Run & Remix
Last active September 30, 2024 19:56
Remix & Cloud Run
So you want to set up remix in cloud run huh? It's pretty simple but i'm going to assume you can figure out most of the GCP UI on your own.
Cloud Run:
Step 1: Create a new service and take note of the service ID
Step 2: Allow all traffic in the /triggers tab
Cloud Build:
Step 1: Set up a Cloud Build trigger on your repo
Step 2: Point the configuration to "cloud build configuration file" at the root of your project
Step 3: Add the following to the substitution variables (so you can keep it safe):
@mikowl
mikowl / oneliners.js
Last active June 29, 2024 17:39
👑 Awesome one-liners you might find useful while coding.
// Inspired by https://twitter.com/coderitual/status/1112297299307384833 and https://tapajyoti-bose.medium.com/7-killer-one-liners-in-javascript-33db6798f5bf
// Remove any duplicates from an array of primitives.
const unique = [...new 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
donker / Login.ascx
Created March 7, 2019 08:47
Login screen skin page for DNN
<%@ 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
sibelius / flow-redux.guideline.md
Created November 10, 2017 16:23
How to easily type Redux Props with Flow

How to easily type Redux Props with Flow

Add ExtractReturn helper

// https://hackernoon.com/redux-flow-type-getting-the-maximum-benefit-from-the-fewest-key-strokes-5c006c54ec87
// https://github.com/facebook/flow/issues/4002
// eslint-disable-next-line no-unused-vars
type _ExtractReturn<B, F: (...args: any[]) => B> = B;
export type ExtractReturn = _ExtractReturn&lt;*, F&gt;;

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
ech01 / DnnScheduleExample.cs
Last active September 13, 2021 18:41
DNN Scheduler Example
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;
@ggravarr
ggravarr / moment-timezone.js
Created July 29, 2016 20:42
flow-typed moment definition with moment-timezone added
type moment$MomentOptions = { // eslint-disable-line no-unused-vars
y?: number|string,
year?: number|string,
years?: number|string,
M?: number|string,
month?: number|string,
months?: number|string,
d?: number|string,
day?: number|string,
days?: number|string,
@bdukes
bdukes / NoDefaultCss.ascx
Created April 11, 2016 21:11
Replace or Remove DNN's Default CSS
<%@ Register TagPrefix="dnn" Namespace="DotNetNuke.Web.Client.ClientResourceManagement" Assembly="DotNetNuke.Web.Client" %>
<dnn:DnnCssExclude runat="server" Name="dnndefault" />
@WebReflection
WebReflection / gist:24c4c475bdeb59405e87
Last active February 15, 2016 15:56
setTimeout and setInterval extra arguments

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) {
    console.log(i);
  }, 0, i); // <== see this?
}