This file contains 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 bash | |
# import an MS SQL .bak backup file to an MS SQL database, then export all | |
# tables to csv. run this script as `import.sh <filename>`. It expects to be | |
# run in the same directory as the backup file. | |
# this is only tested on my mac (OS X Catalina). I tried to stick to posix, but | |
# It will probably require some tweaking for you. I hope it gives a general | |
# sense of what you need to do at the very least. |
This file contains 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 bash | |
# many settings from https://raw.githubusercontent.com/mathiasbynens/dotfiles/master/.macos | |
# many settings from https://raw.githubusercontent.com/thoughtbot/laptop/master/mac | |
# instructions on finding the default you've changed: https://pawelgrzybek.com/change-macos-user-preferences-via-command-line/ | |
# previous install notes at: | |
# https://gist.github.com/llimllib/ee591266e05bd880629a4e7511a61bb3 | |
# https://gist.github.com/llimllib/e864a92da94ceb1ef0da2e06fd1f8d70 | |
# https://gist.github.com/llimllib/3fc4fefcfc0152dad8c58201246d8802 | |
# | |
# this script's URL is: https://gist.github.com/llimllib/c4dd0a98a426022b0365d4c0a9090460 |
This file contains 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 bash | |
# many settings from https://raw.githubusercontent.com/mathiasbynens/dotfiles/master/.macos | |
# many settings from https://raw.githubusercontent.com/thoughtbot/laptop/master/mac | |
# instructions on finding the default you've changed: https://pawelgrzybek.com/change-macos-user-preferences-via-command-line/ | |
# previous install notes at: | |
# https://gist.github.com/llimllib/ee591266e05bd880629a4e7511a61bb3 | |
# https://gist.github.com/llimllib/e864a92da94ceb1ef0da2e06fd1f8d70 | |
fancy_echo() { | |
local fmt="$1"; shift |
This file contains 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 bash | |
# many settings from https://raw.githubusercontent.com/mathiasbynens/dotfiles/master/.macos | |
# many settings from https://raw.githubusercontent.com/thoughtbot/laptop/master/mac | |
# instructions on finding the default you've changed: https://pawelgrzybek.com/change-macos-user-preferences-via-command-line/ | |
# previous install notes at: | |
# https://gist.github.com/llimllib/ee591266e05bd880629a4e7511a61bb3 | |
# https://gist.github.com/llimllib/e864a92da94ceb1ef0da2e06fd1f8d70 | |
# https://gist.github.com/llimllib/aa4420cac617774ee2a54d8603d862e4 | |
fancy_echo() { |
This file contains 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 bash | |
# | |
# Installation (OS X): | |
# | |
# - save this file as "gpt" somewhere in your path | |
# - get an openai api key at: https://platform.openai.com/account/api-keys | |
# - save the openai api key to your keychain with: | |
# security add-generic-password -s 'openai' -a '<account name>' -w '<api key>' | |
# - If you don't already have `jq`, install it with `brew install jq` or whatever | |
# |
This file contains 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
from collections import UserList | |
from functools import partial | |
from operator import add | |
# a class that allows a subclass to declare a function to use to handle all protocols | |
class CustomApplyList(UserList): | |
def __init__(self, f, args): | |
super().__init__(args) | |
self.f = f |
This file contains 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
# https://voidlinux.org/usage/xbps/ is a handy site for docs that isn't linked | |
# from the docs page, for whatever reason. Gives good xbps-* examples | |
# install non-free repository: | |
sudo xbps-install void-repo-nonfree | |
# update the system; all installs failed before this: | |
sudo xbps-install -Su | |
# xbps is hard to type. Add these aliases to your bashrc if xbps-install is |
This file contains 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 bash | |
set -euo pipefail | |
function usage { | |
cat <<"EOF" | |
gif.sh [-rv] image.gif | |
display image.gif on your tidbyt. Assumes you have `pixlet` installed, and that | |
the device you want to display it on is the first in the list of `pixlet | |
devices` |
This file contains 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
import json | |
from pprint import pprint as pp | |
def jenks_matrices_init(data, n_classes): | |
#fill the matrices with data+1 arrays of n_classes 0s | |
lower_class_limits = [] | |
variance_combinations = [] | |
for i in xrange(0, len(data)+1): | |
temp1 = [] | |
temp2 = [] |
This file contains 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
# download_all_emoji.py: A script to query the slack API for all emojis on a | |
# given instance, and then download them into an "emojis" folder | |
# | |
# USAGE | |
# | |
# first, set a `SLACK_TOKEN` environment variable to a token that has | |
# `emoji:read` permission. Then, run this script with | |
# `python download_all_emoji.py`. | |
# | |
# it does not run in parallel, so it may take a while. Are you really |
NewerOlder