Skip to content

Instantly share code, notes, and snippets.

@sg-s
sg-s / poetry-apple-silicon.md
Created January 9, 2023 20:18
Getting poetry working on Macs with Apple Silicon

Problem

poetry shits the bed when trying to install ipykernel on Macs with Apple Silicon

reason

Microsoft.

Yeah. They made something called debugpy that ipykernel depends on which fails for inscritable reasons.

@benlansdell
benlansdell / filepicker.py
Last active April 18, 2024 16:52
FilePicker for streamlit
"""FilePicker for streamlit.
Still doesn't seem to be a good solution for a way to select files to process from the server Streamlit is running on.
Here's a pretty functional solution.
Usage:
```
import streamlit as st
require 'set'
def read_most_common_words
File.read('100_000-english.txt').split("\n")
end
def read_etymologies
File.read('etymwn-20130208/etymologies.tsv').split("\n").map do |line|
parts = line.downcase.split("\t")
[parts[0], parts[2]]
@sg-s
sg-s / github-with-more-than-one-person.md
Last active April 23, 2021 17:10
Github with more than one person

You submitted a patch to someone else's repository, and now you want your fork to sync with their repo

  1. Clone your fork (if you haven't already)
  2. git remote add upstream git://github.com/ORIGINAL-DEV-USERNAME/REPO-YOU-FORKED-FROM.git
  3. git fetch upstream
  4. git pull upstream master

Someone else has opened a PR on your repo, and you want to check that their code works before merging

A common problem in software development and research is the "do-something"-"save data" loop. Often we are saving structured data over and over again, and this document looks at the fastest way to do this.

Solutions I will not consider

Writing each chunk of data to its own file

I will not consider this because:

  1. how do we combine these files later? This just kicks the can down the road
@rudelm
rudelm / autofs.md
Last active April 23, 2024 18:17
Use autofs on Mac OS X to mount network shares automatically during access

Autofs on Mac OS X

With autofs you can easily mount network volumes upon first access to the folder where you want to mount the volume. Autofs is available for many OS and is preinstalled on Mac OS X so I show you how I mounted my iTunes library folder using this method.

Prepare autofs to use a separate configuration file

autofs needs to be configured so that it knows where to gets its configuration. Edit the file /etc/auto_master and add the last line:

#
# Automounter master map
#

+auto_master # Use directory service

@loderunner
loderunner / osx-ld.md
Last active March 21, 2024 07:52
potential blog posts

ld – Wading through Mac OS X linker hell

Intro

Friend: I tried looking at static linking in Mac OS X and it seems nearly impossible. Take a look at this http://stackoverflow.com/a/3801032

Me: I have no idea what that -static flag does, but I'm pretty sure that's not how you link to a library. Let me RTFM a bit.

Minutes later...

@sg-s
sg-s / browsing.md
Last active December 21, 2015 17:54 — forked from atcuno/gist:3425484ac5cce5298932
HowTo: Privacy & Security Conscious Browsing

The purpose of this document is to make recommendations on how to browse in a privacy and security conscious manner. This information is compiled from a number of sources, which are referenced throughout the document, as well as my own experiences with the described technologies.

I welcome contributions and comments on the information contained. Please see the "How to Contribute" section for information on contributing your own knowledge.

Table of Contents

@mvaneijgen
mvaneijgen / material-theme.terminal
Created June 15, 2015 20:27
material-theme.terminal
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>ANSIBlackColor</key>
<data>
YnBsaXN0MDDUAQIDBAUGKSpYJHZlcnNpb25YJG9iamVjdHNZJGFyY2hpdmVyVCR0b3AS
AAGGoKcHCBMXGyImVSRudWxs1QkKCwwNDg8QERJcTlNDb21wb25lbnRzVU5TUkdCXE5T
Q29sb3JTcGFjZV8QEk5TQ3VzdG9tQ29sb3JTcGFjZVYkY2xhc3NPECgwLjAyNzQ1MTAw
NjcgMC4yMTE3NjQ3MjMxIDAuMjU4ODIzNDg0MiAxTxAoMC4wMzkzODA3NDc4MiAwLjE2
@tsiege
tsiege / The Technical Interview Cheat Sheet.md
Last active April 20, 2024 16:52
This is my technical interview cheat sheet. Feel free to fork it or do whatever you want with it. PLEASE let me know if there are any errors or if anything crucial is missing. I will add more links soon.

ANNOUNCEMENT

I have moved this over to the Tech Interview Cheat Sheet Repo and has been expanded and even has code challenges you can run and practice against!






\