Skip to content

Instantly share code, notes, and snippets.

View singularitti's full-sized avatar
🎯
Focusing

Qi Zhang singularitti

🎯
Focusing
View GitHub Profile
@brantfaircloth
brantfaircloth / sphinx_to_github.sh
Created January 23, 2011 02:40
Sphinx documentation to github gh-pages without submodules
# assume the following directory structure where contents of doc/
# and source/ are already checked into repo., with the exception
# of the _build directory (i,e. you can check in _themes or _sources
# or whatever else).
#
# proj/
# source/
# doc/
# remove doc/_build/html if present
@ramnathv
ramnathv / gh-pages.md
Created March 28, 2012 15:37
Creating a clean gh-pages branch

Creating a clean gh-pages branch

This is the sequence of steps to follow to create a root gh-pages branch. It is based on a question at [SO]

cd /path/to/repo-name
git symbolic-ref HEAD refs/heads/gh-pages
rm .git/index
git clean -fdx
echo "My GitHub Page" > index.html
@jexchan
jexchan / multiple_ssh_setting.md
Created April 10, 2012 15:00
Multiple SSH keys for different github accounts

Multiple SSH Keys settings for different github account

create different public key

create different ssh key according the article Mac Set-Up Git

$ ssh-keygen -t rsa -C "[email protected]"
@MikeInnes
MikeInnes / startup.jl
Last active April 28, 2025 14:51
Some useful macros for Julia
# Repeat an operation n times, e.g.
# @dotimes 100 println("hi")
macro dotimes(n, body)
quote
for i = 1:$(esc(n))
$(esc(body))
end
end
end
@wcooley
wcooley / Makefile.dash
Last active August 6, 2021 07:38
Building 3rd Party Sphinx Docs for Dash
# docs/Makefile.dash
include Makefile
PROJECT_NAME = $(shell python ../setup.py --name)
.PHONY: dashdoc
dashdoc:
$(SPHINXBUILD) -b html $(ALLSPHINXOPTS) -D 'html_theme=epub' $(BUILDDIR)/dashdoc
doc2dash -A -v -n $(PROJECT_NAME) -d $(BUILDDIR)/ -f -I index.html -j $(BUILDDIR)/dashdoc
@echo
@echo "Build finished. The Docset is in $(BUILDDIR)/$(PROJECT_NAME).docset."
@jonjack
jonjack / add-update-refresh-github-access-token-on-mac.md
Last active October 6, 2025 09:37
Adding & Updating GitHub Access Token on Mac

Using an Access Token for the first time

Follow the instructions on Github to Create an Access Token in Github

Configure Git to use the osxkeychain

By default, git credentials are not cached so you need to tell Git if you want to avoid having to provide them each time Github requires you to authenticate. On Mac, Git comes with an “osxkeychain” mode, which caches credentials in the secure keychain that’s attached to your system account.

You can tell Git you want to store credentials in the osxkeychain by running the following:-

@singularitti
singularitti / extensions.json
Last active September 12, 2025 12:07
VSCode Settings
[
{
"id": "3dy3day.visual-markdown-table-editor",
"name": "visual-markdown-table-editor",
"publisher": "3dy3day",
"version": "1.0.2"
},
{
"id": "adam-bender.commit-message-editor",
"name": "commit-message-editor",
@singularitti
singularitti / .brew.jl
Last active October 4, 2025 11:27
Homebrew snippets #macOS #Homebrew
using IOCapture
function livecheck(cask)
try
c = IOCapture.capture() do
run(`brew livecheck --cask $cask`)
end
str = c.output
regex = Regex(cask * ":[ ]+([^=]+)[ ]+==>[ ]+([^\n]+)")
m = match(regex, str)
@singularitti
singularitti / PacletUninstallAll.wls
Last active May 31, 2024 05:43
Uninstall all paclets #Mathematica
dirs = FileNameJoin[{$HomeDirectory, $BasePacletsDirectory,
"Repository", "*"}] // FileNames
paclets = Map[StringSplit[FileNameSplit[#][[-1]], "-"][[1]] &, dirs]
Map[PacletUninstall, paclets]
@singularitti
singularitti / dock.sh
Created August 21, 2023 22:37
Manage macOS Dock #macOS #Shell
# Reset Dock to default layout
defaults delete com.apple.dock; killall Dock
# Dim hidden apps
defaults write com.apple.Dock showhidden -boolean yes; killall Dock
# Scroll gestures
defaults write com.apple.dock scroll-to-open -bool true && killall Dock
# Show "Quit Finder" menu item