Skip to content

Instantly share code, notes, and snippets.

@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")

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


@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
@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)
@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
@atamborrino
atamborrino / gist:4f66b4a47a1785f150e7b813cae7041e
Created August 24, 2018 12:32
Churn prediction / Timeseries classification links

Classic ML:

Class imbalance:

DL:

@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

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
@Kruemelkatze
Kruemelkatze / ! Theming Ant Design with Sass and Webpack.md
Last active April 5, 2023 13:25
Theming Ant Design with Sass and Webpack

Theming Ant Design with Sass and Webpack

This is a solution on how to theme/customize Ant Design (which is written in Less) with Sass and webpack. Ant itself offers two solutions and a related article on theming, but these are only applicable if you use Less, the antd-init boilerplate or dva-cli.

What this solution offers:

  • use a single sass-file to customize (no duplicate variables for your project and Ant)
  • hot reload compatibility
  • no dependencies on outdated npm modules
  • easy integration with your existing webpack setup (webpack 3+ tested)
@TheNeuralBit
TheNeuralBit / README.md
Last active November 27, 2022 06:04
Scrabble Arrow

Scrabble Data in an Arrow file

538's data on 45 years of Scrabble games turned into an Arrow file

Usage:

$ python scrabble.py https://media.githubusercontent.com/media/fivethirtyeight/data/master/scrabble-games/scrabble_games.csv scrabble.arrow