Skip to content

Instantly share code, notes, and snippets.

@ogrisel
ogrisel / numpy_pickle_protocol_5.py
Last active October 13, 2019 09:17
Draft use of pickle protocol 5 (PEP 574) for zero-copy numpy array pickling
from pickle import Pickler, load
try:
from pickle import PickleBuffer
except ImportError:
PickleBuffer = None
import copyreg
import os
import numpy as np
import time
@rjenc29
rjenc29 / gist:e0b15089d10a2b9045c397793f22f35a
Last active September 1, 2020 07:11
numba ewma - speed comparison
import numpy as np
import pandas as pd
from numba import njit
import time
@njit
def ewma_version_1(x, halflife):
decay_coefficient = np.exp(np.log(0.5) / halflife)
out = np.empty_like(x, dtype=np.float64)
@nszceta
nszceta / pyenv-3.6.3-optimized-installation.sh
Last active November 2, 2020 13:59
pyenv: Python 3.6.3 optimized installation
MAKE_OPTS="-j8" \
CONFIGURE_OPTS="--enable-shared --enable-optimizations --with-computed-gotos" \
CFLAGS="-march=native -O2 -pipe" \
pyenv install -v 3.6.3
@austospumanto
austospumanto / gist:6857f9bdbc5b3c8fb2c3a1f0d1bdae12
Created April 30, 2021 18:39 — forked from christofluethi/gist:646ae60d797a46a706a5
Convert m4a to mp3 on OS X command line using ffmpeg
brew update
brew link yasm
brew link x264
brew link lame
brew link xvid
brew install ffmpeg
ffmpeg wiki:
https://trac.ffmpeg.org/wiki/Encode/MP3

Philosopher AI

The first line below (in italics) is the prompt I gave to OpenAI's GPT-3. Along the way, I made sure to re-prompt GPT-3 by prepending each run with "Philosopher AI:". This helps to keep it from rambling, and start a fresh thought.

After about the first ten quotes, we started appending a few words to the prompt to get more specific answers. All generated content is in bold, to distinguish it from the prompts.

Most of these are first tries. I removed one due to repetition, and one due to being off-topic. Otherwise success rate has been incredibly high (>90%).


# custom IntelliJ IDEA properties
editor.zero.latency.typing=true
idea.max.intellisense.filesize=3500
idea.cycle.buffer.size=2048

How do roadmap, bro?

Collection of wisdom from other people.

Why you should stop using product roadmaps?

Read

  • No split of ideation, planning and execution — they all happen concurrently all the time
@dasim
dasim / mods.css
Created January 10, 2012 15:00
Trello modifications CSS. Smaller fonts, larger cards, more info in one screen.
h3.list-card-title a {
font-size: 11px;
}
div.action-comment p {
font-size: 11px;
}
a.inline-object.action-card {
font-size: 12px;
@nitrocode
nitrocode / catovpn_restart.scpt
Last active May 18, 2022 21:30
Restart Cato on a schedule using an applescript and launchd
#!/usr/bin/osascript
(*
author: nitrocode
source: https://gist.github.com/nitrocode/559f1717ee5d610c3548b3e056b84e5e
Leave this commented block in case this file is ever updated or forked so it will be easier to update and audit in the future.
*)
tell application "System Events"
(* kill cato *)
set theID to (unix id of processes whose name is "CatoClient")
@robnyman
robnyman / IndexedDB-storing-and-retrieving-files.js
Created February 23, 2012 17:55
IndexedDB storing and retrieving files
(function () {
// IndexedDB
var indexedDB = window.indexedDB || window.webkitIndexedDB || window.mozIndexedDB || window.OIndexedDB || window.msIndexedDB,
IDBTransaction = window.IDBTransaction || window.webkitIDBTransaction || window.OIDBTransaction || window.msIDBTransaction,
dbVersion = 1.0;
// Create/open database
var request = indexedDB.open("elephantFiles", dbVersion),
db,
createObjectStore = function (dataBase) {