Skip to content

Instantly share code, notes, and snippets.

@macd2
macd2 / webstorm64.vmoptions
Created November 20, 2018 21:10 — forked from bitclaw/webstorm64.vmoptions
Jetbrains Custom VM Options Optimized Configuration: Performance tuning parameters for IntelliJ IDEA. Add these params in idea64.exe.vmoptions or idea.exe.vmoptions file in IntelliJ IDEA. If you are using JDK 8.x, please knock off PermSize and MaxPermSize parameters from the tuning configuration.
# custom WebStorm VM options, this configuration also works well for other IDEs like phpstorm, pycharm..etc.
-Xms1024m
-Xmx2048m
-XX:ReservedCodeCacheSize=240m
-XX:+UseConcMarkSweepGC
-XX:SoftRefLRUPolicyMSPerMB=50
-ea
-Dsun.io.useCanonCaches=false
-Djava.net.preferIPv4Stack=true
@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)
@saikishandasari
saikishandasari / Dockerfile
Created June 24, 2019 05:25
Custom runtime to install pyodbc on Google App Engine
# Load the base image provided by Google
FROM gcr.io/google-appengine/python
# Install tdsodbc & unixodbc
RUN apt-get update
RUN apt-get install -y tdsodbc unixodbc-dev
RUN apt install unixodbc-bin -y
RUN apt-get clean -y
ADD odbcinst.ini /etc/odbcinst.ini

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%).


@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")
@progrium
progrium / README.md
Last active July 19, 2025 19:41
Setting up M1 Macs for x86 development with Homebrew

Key Points

  • In general, binaries built just for x86 architecture will automatically be run in x86 mode
  • You can force apps in Rosetta 2 / x86 mode by right-clicking app, click Get Info, check "Open using Rosetta"
  • You can force command-line apps by prefixing with arch -x86_64, for example arch -x86_64 go
  • Running a shell in this mode means you don't have to prefix commands: arch -x86_64 zsh then go or whatever
  • Don't just immediately install Homebrew as usual. It should most likely be installed in x86 mode.

Homebrew

Not all toolchains and libraries properly support M1 arm64 chips just yet. Although

@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
# custom IntelliJ IDEA properties
editor.zero.latency.typing=true
idea.max.intellisense.filesize=3500
idea.cycle.buffer.size=2048
@snejus
snejus / deps
Last active December 12, 2024 09:59
See python package's direct and reverse dependencies, and version changes between revisions in milliseconds
#!/bin/zsh
# Read poetry.lock and display information about dependencies:
#
# * Project dependencies
# * Sub-dependencies and reverse dependencies of packages
# * Summary of updates, or change in dependency versions between two revisions of the project
#
# Author: Sarunas Nejus, 2021
# License: MIT
@kesor
kesor / 1-voice-synthesis.js
Last active March 7, 2024 00:19
Making chat OpenAI use TTS
// paste this into your chrome dev console for Speech Synthesis
const originalFetch = window.fetch
const patchedFetch = (...args) => {
if (args[1].method == 'POST' && args[1].body.length > 0 && /moderations$/.test(args[0])) {
const aiResponse = JSON.parse(args[1].body)["input"].split("\n\n\n")
if (aiResponse.length > 1) {
const text = aiResponse.slice(1).join(". ").trim()
console.log(text)