This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
int main(int argc, char **argv) { | |
printf("Hello world!"); | |
return 0; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#! /usr/bin/python | |
# | |
# Church numerals in Python. | |
# See http://en.wikipedia.org/wiki/Church_encoding | |
# | |
# Vivek Haldar <[email protected]> | |
# | |
# https://gist.github.com/2438498 | |
zero = lambda f: lambda x: x |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//#!/usr/bin/env node --harmony | |
/*jshint esversion: 6 */ | |
'use strict'; | |
// Church numerals in ES6. | |
// c.f. https://en.wikipedia.org/wiki/Church_encoding | |
// Zero is the identity function. | |
let zero = (f => x => x); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
# | |
# Based on a script by Donald Feury | |
# https://gitlab.com/dak425/scripts/-/blob/master/trim_silenceV2 | |
# https://youtu.be/ak52RXKfDw8 | |
import math | |
import sys | |
import subprocess | |
import os |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
import math | |
import sys | |
from moviepy.editor import AudioClip, VideoFileClip, concatenate_videoclips | |
# Get average RGB of part of a frame. Frame is H * W * 3 (rgb) | |
# Assumes x1 < x2, y1 < y2 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python3 | |
import whisper | |
import sys | |
import string | |
import math | |
from stable_whisper import modify_model | |
from stable_whisper import stabilize_timestamps | |
from stable_whisper import results_to_word_srt | |
from stable_whisper import results_to_word_srt | |
from moviepy.editor import AudioClip, VideoFileClip, concatenate_videoclips |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
devenv.sh: | |
{ pkgs, ... }: | |
{ | |
env.GREET = "Python-based dev env for copy-pics"; | |
languages.python = { | |
enable = true; | |
poetry.enable = true; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
;; Emacs Lisp wrapper around Python scripts for ChatGPT. | |
;; | |
;; Basic idea is to send buffer as stdin to Python script. | |
(defvar gpt-script "/Users/haldar/haskell/gpt_turbo/chat.py") | |
(defun vh/invoke-chat () | |
"Send contents of current buffer as stdin to command, then append output to current buffer." | |
(interactive) | |
(let* |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python3 | |
# | |
# Takes a chat transcript (for ChatGPT) on stdin, calls the OpenAI | |
# ChatGPT API, and prints the response on stdout. | |
# | |
# Your OpenAI API key must be set in the environment variable | |
# OPENAI_API_KEY. | |
# | |
# Logs are written to ~/chat.log. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
;; emacs-gpt.el -- Control Emacs via ChatGPT | |
;; | |
;; Basic idea: take natural language input from user, ask ChatGPT for | |
;; corresponding elisp, run it. | |
(defun mark-between-assistant-and-user () | |
"Mark the region between \"%assistant%\" and \"%user%\", not including those strings." | |
(interactive) | |
(goto-char (point-min)) |
OlderNewer