Skip to content

Instantly share code, notes, and snippets.

View christianscott's full-sized avatar

Christian Scott christianscott

View GitHub Profile
import os
from dotenv import load_dotenv
import requests
from slack_sdk import WebClient
from slack_sdk.errors import SlackApiError
from datetime import date
from collections import defaultdict
import modal
load_dotenv()
@bvaughn
bvaughn / updating-external-data-when-props-changes-using-promises.js
Last active June 16, 2024 21:56
Example for loading new external data in response to updated props
// This is an example of how to fetch external data in response to updated props,
// If you are using an async mechanism that does not support cancellation (e.g. a Promise).
class ExampleComponent extends React.Component {
_currentId = null;
state = {
externalData: null
};

In this tutorial we're going to build a set of parser combinators.

What is a parser combinator?

We'll answer the above question in 2 steps.

  1. What is a parser?
  2. and, what is a parser combinator?

So first question: What is parser?

@nguyen-phillip
nguyen-phillip / proc.c
Last active November 30, 2023 13:01
Using libproc.h
#include <stdio.h>
#include <stdlib.h>
#include <libproc.h>
// Uses proc_pidinfo from libproc.h to find the parent of given pid.
// Call this repeatedly until ppid(pid) == pid to get ancestors.
int ppid(pid_t pid) {
struct proc_bsdinfo info;
proc_pidinfo(pid, PROC_PIDTBSDINFO, 0, &info, sizeof(info));
return info.pbi_ppid;
@clintel
clintel / gist:1155906
Created August 19, 2011 02:40
Fenced code in bullet lists with GitHub-flavoured MarkDown??

Fenced code blocks inside ordered and unordered lists

  1. This is a numbered list.

  2. I'm going to include a fenced code block as part of this bullet:

    Code
    More Code