Skip to content

Instantly share code, notes, and snippets.

package interfacesexample
type Foo interface {
AAA() bool
AAB() bool
AAC() bool
AAD() bool
AAE() bool
AAF() bool
AAG() bool
import csv, os, sys
"""
A bash script I also looked at for a while, but ended up being less useful than just a filtered view of the CSVs.
function diff-clients() {
xsv select '!"Icon","Last seen","Channel","Signal"' "$1" | xsv sort -s MAC -o /tmp/before.csv
xsv select '!"Icon","Last seen","Channel","Signal"' "$2" | xsv sort -s MAC -o /tmp/after.csv
csv-diff --key MAC /tmp/before.csv /tmp/after.csv
import Interval, { io, ctx } from "@interval/sdk";
import 'dotenv/config';
const interval = new Interval({
apiKey: process.env.INTERVAL_KEY,
endpoint: process.env.INTERVAL_ENDPOINT,
routes: {
image_generation: async () => {
const { prompt, n, size } = await io.group({
prompt: io.input.text('Prompt', {
@jacobmischka
jacobmischka / cmd-h-to-cmd-g-nvim-gtk.json
Created March 8, 2022 19:49
Karabiner cmd+h to cmd+g in nvim-gtk
{
"title": "Cmd+h to Cmd+g in nvim-gtk",
"rules": [
{
"description": "Cmd+h to cmd+g in nvim-gtk",
"manipulators": [
{
"type": "basic",
"description": "",
"from": {
impl Location {
pub fn is_in_or(&self) -> bool {
use Location::*;
match self {
OrCmh | OrCmhEct | OrDtssc | OrFhIpp | OrFhe | OrFhw | OrFsc | OrLcsc | OrObCmh
| OrObFh | OrObSjh | OrSjh | OrWbsc => true,
_ => false,
}
}
{
// This is disgusting, I think I could use streams instead
let all_mentorships = fetch_records::<Mentorship>(&ids, &dates);
let all_publications = fetch_records::<Publication>(&ids, &dates);
let all_presentations = fetch_records::<Presentation>(&ids, &dates);
let all_research_grants_awards = fetch_records::<ResearchGrantAward>(&ids, &dates);
let all_committee_service = fetch_records::<CommitteeService>(&ids, &dates);
let all_leadership_positions =
fetch_records::<LeadershipAndCommitteePosition>(&ids, &dates);
let all_program_developments = fetch_records::<ProgramDevelopment>(&ids, &dates);
workflow "New workflow" {
on = "push"
resolves = ["maddox/actions/ssh@master"]
}
action "maddox/actions/ssh@master" {
uses = "maddox/actions/ssh@master"
args = "/root/update.sh"
secrets = ["HOST", "USER", "PUBLIC_KEY", "PRIVATE_KEY"]
}
/** @format */
const webpack = require('webpack');
const dotenv = require('dotenv');
const config = require('sapper/config/webpack.js');
const pkg = require('./package.json');
dotenv.config();
const { NODE_ENV, ROLLBAR_CLIENT_ACCESS_TOKEN } = process.env;
use std::env;
use std::io::{self, Write};
use std::process::{self, Command};
fn main() -> io::Result<()> {
let mut shell = Shell::new();
shell.spawn()
}
struct Shell {