Skip to content

Instantly share code, notes, and snippets.

View dougludlow's full-sized avatar
🏠
Working from home

Douglas Ludlow dougludlow

🏠
Working from home
View GitHub Profile
@EtherZa
EtherZa / pre-commit
Created August 12, 2019 02:53
Format c# with dotnet-format with pre-commit hook
#!/bin/sh
#
# modified from sample: https://prettier.io/docs/en/precommit.html
#
# install dotnet-format: dotnet tool install -g dotnet-format
# copy to .git/hooks/pre-commit and make executable
#
FILES=$(git diff --cached --name-only --diff-filter=ACM "*.cs" | sed 's| |\\ |g')
@gricard
gricard / webpack4upgrade.md
Last active February 29, 2024 20:23
Just some notes about my attempt to upgrade to webpack 4

If you enjoyed reading this, I'm intending to do more blogging like this over here: https://cdgd.tech

This is not a complaint about Webpack or v4 in any way. This is just a record of my process trying it out so I could provide feedback to the webpack team

Hmm... I don't see any docs for 4.0 on https://webpack.js.org. I guess I'll just wing it. All I need to do is npm i -D webpack@next, right?

+ webpack@4.0.0-beta.2
@zparnold
zparnold / one_liner.sh
Last active May 6, 2024 13:14
A simply script to delete all failed pods from Kubernetes
kubectl get pods --all-namespaces | grep Evicted | awk '{print $2 " --namespace=" $1}' | xargs kubectl delete pod
@SheldonWangRJT
SheldonWangRJT / Convert .mov or .MP4 to .gif.md
Last active May 6, 2024 13:53
Convert Movie(.mov) file to Gif(.gif) file in one command line in Mac Terminal

This notes is written by Sheldon. You can find me with #iOSBySheldon in Github, Youtube, Facebook, etc.

Need

Convert .mov/.MP4 to .gif

Reason

As a developer, I feel better to upload a short video when I create the pull request to show other viewers what I did in this PR. I tried .mov format directly got after finishing recording screen using Quicktime, however, gif offers preview in most web pages, and has smaller file size.

This is not limited to developer, anyone has this need can use this method to convert the files.

@camalot
camalot / .bashrc
Last active March 8, 2020 03:20
Some helper scripts to allow access of the Windows Environment Variables from within Bash (in WSL)
#!/usr/bin/env bash
source ~/.wsl_helper.bash
eval $(winenv)
@samthor
samthor / safari-nomodule.js
Last active February 14, 2024 02:54
Safari 10.1 `nomodule` support
// UPDATE: In 2023, you should probably stop using this! The narrow version of Safari that
// does not support `nomodule` is probably not being used anywhere. The code below is left
// for posterity.
/**
* Safari 10.1 supports modules, but does not support the `nomodule` attribute - it will
* load <script nomodule> anyway. This snippet solve this problem, but only for script
* tags that load external code, e.g.: <script nomodule src="nomodule.js"></script>
*
* Again: this will **not** prevent inline script, e.g.:
@marioharper
marioharper / clean-docker.sh
Last active July 31, 2023 12:44
Stop all docker processes, remove all containers, remove all images
# stop all processes
docker stop $(docker ps -aq)
# remove all containers
docker rm $(docker ps -aq)
# remove all images
docker rmi $(docker images -aq)
# delete all volumes
@tugberkugurlu
tugberkugurlu / ComplexTypeConvention.cs
Created April 6, 2016 15:16
Bind complex type objects from body by default on ASP.NET Core 1
using Microsoft.AspNet.Mvc.ApplicationModels;
using Microsoft.AspNet.Mvc.ModelBinding;
using System;
namespace Foo.Web.Infrastructure.Conventions
{
public class ComplexTypeConvention : IActionModelConvention
{
public void Apply(ActionModel action)
{
@xjamundx
xjamundx / blog-webpack-2.md
Last active April 21, 2024 16:20
From Require.js to Webpack - Part 2 (the how)

This is the follow up to a post I wrote recently called From Require.js to Webpack - Party 1 (the why) which was published in my personal blog.

In that post I talked about 3 main reasons for moving from require.js to webpack:

  1. Common JS support
  2. NPM support
  3. a healthy loader/plugin ecosystem.

Here I'll instead talk about some of the technical challenges that we faced during the migration. Despite the clear benefits in developer experience (DX) the setup was fairly difficult and I'd like to cover some of the challanges we faced to make the transition a bit easier.

@davidfowl
davidfowl / dotnetlayout.md
Last active May 5, 2024 11:47
.NET project structure
$/
  artifacts/
  build/
  docs/
  lib/
  packages/
  samples/
  src/
 tests/