Skip to content

Instantly share code, notes, and snippets.

View sinewalker's full-sized avatar

Michael Lockhart sinewalker

View GitHub Profile
#/bin/bash
#-- Script to automate https://help.github.com/articles/why-is-git-always-asking-for-my-password
# Forked from the original to do the opposite: Switch ssh repo urls to https
# Original here: https://gist.github.com/m14t/3056747
# Thanks to @m14t
#origin or upstream
REMOTE=${1-origin}
REPO_URL=`git remote -v | grep -m1 "^$REMOTE" | sed -Ene's#.*(git@github.com:[^[:space:]]*).*#\1#p'`
@jsomers
jsomers / websockets.md
Created September 27, 2018 12:50
Using websockets to easily build GUIs for Python programs

Using websockets to easily build GUIs for Python programs

I recently built a small agent-based model using Python and wanted to visualize the model in action. But as much as Python is an ideal tool for scientific computation (numpy, scipy, matplotlib), it's not as good for dynamic visualization (pygame?).

You know what's a very mature and flexible tool for drawing graphics? The DOM! For simple graphics you can use HTML and CSS; for more complicated stuff you can use Canvas, SVG, or WebGL. There are countless frameworks, libraries, and tutorials to help you draw exactly what you need. In my case, this was the animation I wanted:

high-priority

(Each row represents a "worker" in my model, and each rectangle represents a "task.")

@bengrosser
bengrosser / mastodon-compose-dark-mode.css
Created December 17, 2022 23:24
Fix mastodon.social's dark mode so that the post compose form is also in dark mode
/* this probably breaks light mode
* totally untested
* but it does fix my problem, which is that the
* mastodon.social dark mode doesn't adjust the
* post composition window to also be in dark mode
*
* I activate the below using the Stylus extension
*/
[skin]
description=Ajnasz Blue Theme. Midnight Commander skin from Ajnasz.
[Lines]
horiz=─
vert=│
lefttop=┌
righttop=┐
leftbottom=└
rightbottom=┘
@JoaquimLey
JoaquimLey / github_multiple-accounts.md
Last active April 30, 2023 22:17
How to Work with GitHub and Multiple Accounts

Step 1 - Create a New SSH Key

We need to generate a unique SSH key for our second GitHub account.

ssh-keygen -t rsa -C "your-email-address"

Be careful that you don't over-write your existing key for your personal account. Instead, when prompted, save the file as id_rsa_COMPANY. In my case, I've saved the file to ~/.ssh/id_rsa_work.

Step 2 - Attach the New Key

@m14t
m14t / fix_github_https_repo.sh
Created July 5, 2012 21:57
Convert HTTPS github clones to use SSH
#/bin/bash
#-- Script to automate https://help.github.com/articles/why-is-git-always-asking-for-my-password
REPO_URL=`git remote -v | grep -m1 '^origin' | sed -Ene's#.*(https://[^[:space:]]*).*#\1#p'`
if [ -z "$REPO_URL" ]; then
echo "-- ERROR: Could not identify Repo url."
echo " It is possible this repo is already using SSH instead of HTTPS."
exit
fi
@haliphax
haliphax / install-gitmoji-hook.sh
Last active September 11, 2023 04:55
Gitmoji CLI commit hook
#!/usr/bin/env bash
# install gitmoji as a commit hook
#
# - uses https://www.npmjs.com/package/gitmoji-cli
# - does not require global module installation
# - skips hook if message already starts with gitmoji
root="$(git rev-parse --show-toplevel)"
hook="$root/.git/hooks/prepare-commit-msg"
@jasongilman
jasongilman / atom_clojure_setup.md
Last active January 11, 2024 09:13
This describes how I setup Atom for Clojure Development.

Atom Clojure Setup

This describes how I setup Atom for an ideal Clojure development workflow. This fixes indentation on newlines, handles parentheses, etc. The keybinding settings for enter (in keymap.cson) are important to get proper newlines with indentation at the right level. There are other helpers in init.coffee and keymap.cson that are useful for cutting, copying, pasting, deleting, and indenting Lisp expressions.

Install Atom

Download Atom

The Atom documentation is excellent. It's highly worth reading the flight manual.

@mziwisky
mziwisky / Oauth2.md
Last active February 15, 2024 23:31
Oauth2 Explanation

OAUTH2

The Problem

I’m a web app that wants to allow other web apps access to my users’ information, but I want to ensure that the user says it’s ok.

The Solution

I can’t trust the other web apps, so I must interact with my users directly. I’ll let them know that the other app is trying to get their info, and ask whether they want to grant that permission. Oauth defines a way to initiate that permission verification from the other app’s site so that the user experience is smooth. If the user grants permission, I issue an AuthToken to the other app which it can use to make requests for that user's info.

Note on encryption

Oauth2 has nothing to do with encryption -- it relies upon SSL to keep things (like the client app’s shared_secret) secure.

@TaylanTatli
TaylanTatli / Custom CSS.css
Last active April 10, 2024 01:35
I created a repo for Miniflux Themes and added a new Catppuccin theme. If anyone interested: https://github.com/TaylanTatli/MinifluxThemes
:root {
--font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";
--body-color: rgba(255, 255, 255, 0.7);
--body-background: #282c34;
--header-link-color: #9b9494;
--header-active-link-color: #d19a66;
--input-border: 1px solid #2c384e;
--input-background: #2c384e;
--input-placeholder-color: #888;
--input-focus-border-color: #d19a66;