Skip to content

Instantly share code, notes, and snippets.

@jacobmischka
jacobmischka / test.html
Created October 17, 2016 16:21
test.html
<html>
<head>
<style>
.container {
width: 100%;
display: flex;
flex-direction: row;
justify-content: space-around;
}
</style>
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
@jacobmischka
jacobmischka / ds4led
Created December 30, 2015 04:20
Changes color for ds4 controller lightbar on linux and gives permissions so games can change it too if they support it.
#!/bin/bash
# This isn't really that safe to blindly run,
# as it uses sudo to change system file permissions.
# Hopefully it shouldn't break anything though.
# Usage: ds4led [r value] [g value] [b value]
# or `ds4led orange` to set it to orange.
DS4="0003:054C:05C4.*"
cd /sys/class/leds
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"]
}