Skip to content

Instantly share code, notes, and snippets.

View Carreau's full-sized avatar
:octocat:

M Bussonnier Carreau

:octocat:
View GitHub Profile
@khalidx
khalidx / node-typescript-esm.md
Last active February 23, 2025 05:46
A Node + TypeScript + ts-node + ESM experience that works.

The experience of using Node.JS with TypeScript, ts-node, and ESM is horrible.

There are countless guides of how to integrate them, but none of them seem to work.

Here's what worked for me.

Just add the following files and run npm run dev. You'll be good to go!

package.json

@troyfontaine
troyfontaine / 1-setup.md
Last active March 9, 2025 06:34
Signing your Git Commits on MacOS

Methods of Signing Git Commits on MacOS

Last updated March 13, 2024

This Gist explains how to sign commits using gpg in a step-by-step fashion. Previously, krypt.co was heavily mentioned, but I've only recently learned they were acquired by Akamai and no longer update their previous free products. Those mentions have been removed.

Additionally, 1Password now supports signing Git commits with SSH keys and makes it pretty easy-plus you can easily configure Git Tower to use it for both signing and ssh.

For using a GUI-based GIT tool such as Tower or Github Desktop, follow the steps here for signing your commits with GPG.

@egmontkob
egmontkob / Hyperlinks_in_Terminal_Emulators.md
Last active March 6, 2025 04:29
Hyperlinks in Terminal Emulators
import ast
import types
import ctypes
# Really what we want, I think are compile modes "async_exec", "async_single",
# "async_eval". These would:
#
# - turn on await
# - turn on the coroutine flags, so that passing the code to exec() returns a
# coroutine object
import jwt
import requests
from time import time
pem_file = '/path/to/github.pem' # the absolute path to your Application Pem Certificate issued by GitHub
integration_id = 0 # GitHub Application Integration ID
installation_id = 0 # once installed on an organization. The Organization Integration ID
expire_seconds = 500 # number of seconds the jwt token expires (max ~600 but not designated by GitHub)
slug = 'owner/repo' # name of repo for demo purposes
@juhasch
juhasch / custom.js
Last active January 3, 2016 04:19
My custom.js for the new IPython notebook 2.0 UI
// leave at least 2 line with only a star on it below, or doc generation fails
/**
*
*
*/
/*
* Wait for app_initialized.NotebookApp trigger
*/
#!/usr/bin/env ruby
#
# git fuzzy-checkout
# Same as `git checkout branch`, but with fuzzy matching if checkout fails.
# Turns `git checkout barnch` into `git checkout branch`,
# assuming `branch` is a branch.
# to use, you can alias:
# alias co="git fuzzy-checkout"
# co msater
// add this to <profile>/static/custom/custom.js to load vim keybindings:
$.getScript("/static/components/codemirror/keymap/vim.js", function() {
if (! IPython.Cell) return;
IPython.Cell.options_default.cm_config.keyMap = "vim";
});
@juhasch
juhasch / euext.py
Last active December 11, 2015 11:59
Allow to use units with numbers in iPython, e.g. "1n"=1e-9 or "1G"=1e9
# -*- coding: utf-8 -*-
"""
IPython extension for engineering units
See README.txt for usage examples.
Author: Juergen Hasch <[email protected]>
Parts taken from the physics.py extension by Georg Brandl <[email protected]>
This file has been placed in the public domain.
Allows units to be specified like
@dwf
dwf / theanoprinting.py
Created December 19, 2012 21:21
IPython extension for automatically PNG-pretty-printing Theano functions with Graphviz.
"""Display Theano functions in the IPython notebook with pydotprint."""
__author__ = "David Warde-Farley"
__copyright__ = "Copyright 2012, Universite de Montreal"
__credits__ = ["David Warde-Farley"]
__license__ = "3-clause BSD"
__email__ = "wardefar@iro"
__maintainer__ = "David Warde-Farley"