Skip to content

Instantly share code, notes, and snippets.

View akilism's full-sized avatar
💭
clicky-clicky-clicky

Akil Harris akilism

💭
clicky-clicky-clicky
View GitHub Profile
@mrphs
mrphs / AMKS-prompt.txt
Last active June 29, 2023 21:40
Advanced Multidisciplinary Knowledge System prompt for gpt-4. This puts chatgpt into a panel of experts who work to get you the best results.
Author: Nima Fatemi @mrphs
Date: June 2023
Permanent link:
https://gist.github.com/mrphs/22564aea824f885ce063b6213218a21c
Description:
============
The prompt guides the GPT-4 model to adopt the Advanced Multidisciplinary
Knowledge System (AMKS) mode. It emphasizes critical thinking, questioning
@yzl
yzl / TechAndEthicsReadingCollection.md
Last active October 5, 2020 22:13
tech and ethics reading collection

Tech and ethics reading collection

A list of books, essays, papers, blog posts, tweets, etc. on tech and ethics that I have either read and found useful or plan to read because I think they might be useful. I’m not especially interested in ethics that doesn’t take power or structure into account, so most of the standard texts one would read in a course on ethics aren’t represented on my list.

(My) starting point

Not strictly about either ethics or tech, but Claire Dederer’s What Do We Do With the Art of Monstrous Men? verbalizes something that is wound up in how I think about ethics, and what I hear when people talk about ethics:

This, I think, is what happens to so many of us when we consider the work of the monster geniuses—we tell ourselves we’re having ethical thoughts when really what we’re having is moral feelings.

Ideal theory

Dr. Robin James recommends Charles Mills’ [Ideal Theory as I

@martinheld
martinheld / GraphQL introspection query via curl.md
Last active April 16, 2024 16:26
GraphQL introspection query via curl

GraphQL introspection query via curl

cat introspection_query.json

{ 
  "query": "query IntrospectionQuery {
      __schema {
        queryType { name }
        mutationType { name }
@muan
muan / details-links.md
Last active December 21, 2019 10:34
Details on details cheatsheet.

gif-from-tweet

There are so many great GIFs out there and I want to have copies of them. Twitter makes that harder than it should be by converting them to MP4 and not providing access to the source material. To make it easier, I made a bash pipeline that takes a tweet URL and a filename, extracts the MP4 from that tweet and uses ffmpeg to convert back to GIF.

Dependencies

  • ffmpeg
    • macOS: brew install ffmpeg
    • Ubuntu/Debian: apt install ffmpeg
#!/bin/bash
set -e
CONTENTS=$(tesseract -c language_model_penalty_non_dict_word=0.8 --tessdata-dir /usr/local/share/tessdata/ "$1" stdout -l eng | xml esc)
hex=$((cat <<EOF
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">

Minimum Viable Async with Node 6

With the release of Node 6.0.0, the surface of code that needs transpilation to use ES6 features has been reduced very dramatically.

This is what my current workflow looks like to set up a minimalistic and fast microservice using micro and async + await.

The promise

@paulirish
paulirish / what-forces-layout.md
Last active April 30, 2024 17:56
What forces layout/reflow. The comprehensive list.

What forces layout / reflow

All of the below properties or methods, when requested/called in JavaScript, will trigger the browser to synchronously calculate the style and layout*. This is also called reflow or layout thrashing, and is common performance bottleneck.

Generally, all APIs that synchronously provide layout metrics will trigger forced reflow / layout. Read on for additional cases and details.

Element APIs

Getting box metrics
  • elem.offsetLeft, elem.offsetTop, elem.offsetWidth, elem.offsetHeight, elem.offsetParent
@bhauman
bhauman / core.cljs
Last active August 16, 2022 12:08
Helpful patterns when developing with ClojureScript Figwheel and Express js
(ns todo-server.core
(:require
[cljs.nodejs :as nodejs]
[figwheel.client :as fw]))
(nodejs/enable-util-print!)
(defonce express (nodejs/require "express"))
(defonce serve-static (nodejs/require "serve-static"))
(defonce http (nodejs/require "http"))
@sebmarkbage
sebmarkbage / Enhance.js
Last active January 31, 2024 18:33
Higher-order Components
import { Component } from "React";
export var Enhance = ComposedComponent => class extends Component {
constructor() {
this.state = { data: null };
}
componentDidMount() {
this.setState({ data: 'Hello' });
}
render() {