Skip to content

Instantly share code, notes, and snippets.

View jpcarrascal's full-sized avatar
💭
www.spacebarman.com

JP Carrascal jpcarrascal

💭
www.spacebarman.com
View GitHub Profile
@osteel
osteel / posts.yml
Created January 10, 2021 16:18
Example GitHub Action to instal Composer dependencies and run a PHP script
name: Update blog posts
on:
push:
workflow_dispatch:
schedule:
- cron: '0 0 * * *'
jobs:
build:

With GitHub Actions, a workflow can publish artifacts, typically logs or binaries. As of early 2020, the life time of an artifact is hard-coded to 90 days (this may change in the future). After 90 days, an artifact is automatically deleted. But, in the meantime, artifacts for a repository may accumulate and generate mega-bytes or even giga-bytes of data files.

It is unclear if there is a size limit for the total accumulated size of artifacts for a public repository. But GitHub cannot reasonably let multi-giga-bytes of artifacts data accumulate without doing anything. So, if your workflows regularly produce large artifacts (such as "nightly build" procedures for instance), it is wise to cleanup and delete older artifacts without waiting for the 90 days limit.

Using the Web page for the "Actions" of a repository, it is possible to browse old workflow runs and manually delete artifacts. But the procedure is slow and tedious. It is fine to delete one selected artifact. It is not for a regular cleanup. We need

@povlhp
povlhp / CrealityLCDPins.md
Created May 24, 2019 12:52
Ender-3 / CR-10 LCD Display Connector pinout

Ender-3 / CR-10 LCD Display Connector pinout

The Creality printers are so popular that it is important to support its display controller. Finding pin mappings on the Internet was impossible (They merged 2x 10-pin to 1x 10-pin)

Here is the secret undiscovered PIN layout of their connector (The button pins might need a swap)

5V        GND
SID       ?
SCLK Btn_En1
@ek
ek / opp-score-jtbd-analysis.md
Last active March 29, 2022 13:57
Process to compute opportunity scores for Jobs to be Done survey analysis

Process to compute opportunity scores for Jobs to be Done survey analysis

Inputs

  • Given an array of outcomes.
  • Given an array of responses to a survey on importance and satisfaction ratings for each of the outcomes.
  • Given the response ratings are 1-5.
  • IMP = 10 x % Very or Extremely important
  • SAT = 10 x % Very or Extremely satisfied
  • OPP = IMP + MAX (IMP-SAT, 0)
  • Values of 4 or 5 are considered Very or Extremely important / satisfied
@danharper
danharper / background.js
Last active March 30, 2024 18:25
Bare minimum Chrome extension to inject a JS file into the given page when you click on the browser action icon. The script then inserts a new div into the DOM.
// this is the background code...
// listen for our browerAction to be clicked
chrome.browserAction.onClicked.addListener(function (tab) {
// for the current tab, inject the "inject.js" file & execute it
chrome.tabs.executeScript(tab.ib, {
file: 'inject.js'
});
});
@glombard
glombard / ClipboardNotification.cs
Created December 16, 2013 12:34
Monitor Clipboard changes in C# using AddClipboardFormatListener / WM_CLIPBOARDUPDATE. See Clipboard class: http://msdn.microsoft.com/en-us/library/system.windows.clipboard(v=vs.110).aspx
// from: http://stackoverflow.com/questions/2226920/how-to-monitor-clipboard-content-changes-in-c
/// <summary>
/// Provides notifications when the contents of the clipboard is updated.
/// </summary>
public sealed class ClipboardNotification
{
/// <summary>
/// Occurs when the contents of the clipboard is updated.
/// </summary>