To automatically add emojis to your commits, you can use the commit-msg
hook.
$ git init
$ ln -s commit-msg-emoji .git/hooks/commit-msg
To automatically add emojis to your commits, you can use the commit-msg
hook.
$ git init
$ ln -s commit-msg-emoji .git/hooks/commit-msg
# a stacked bar plot with errorbars | |
%config InlineBackend.figure_format = 'retina' | |
import pandas as pd | |
from random import random | |
import matplotlib.pyplot as plt | |
def autolabel(rects): | |
""" | |
Attach a text label above each bar displaying its height |
<!DOCTYPE html> | |
<html> | |
<head> | |
<title>JSCodeshift</title> | |
<meta charset="utf-8"> | |
<style> | |
@import url(https://fonts.googleapis.com/css?family=Yanone+Kaffeesatz); | |
@import url(https://fonts.googleapis.com/css?family=Droid+Serif:400,700,400italic); | |
@import url(https://fonts.googleapis.com/css?family=Ubuntu+Mono:400,700,400italic); |
const { createClientInteractive } = require('cozy-client/dist/cli') | |
const { ArgumentParser } = require('argparse') | |
const main = async () => { | |
const parser = new ArgumentParser() | |
parser.addArgument('--url', { defaultValue: 'http://cozy.tools:8080' }) | |
parser.addArgument('--platform') | |
parser.addArgument('--registrationToken') | |
const client = await createClientInteractive({ |
#!/bin/bash | |
# rlink is useful when you are working in packages used in other packages/apps. Normally you | |
# would use yarn link but it can cause problems since node_modules are resolved inside the | |
# linked directory instead of the host directory. Here, the "link" is done the hard way with | |
# nodemon and rsync, ensuring that the node_modules/<package> corresponds to the linked package. | |
# Location of the linked packages is found by using the directory where yarn stores its symbolic | |
# links. | |
# | |
# ## Installation |
If you deal with commands that can take several seconds but always return the same result and you need to transform the result with pipe chain (jq / grep / awk), it can be annoying to wait for those seconds while you incrementally build the command, when you know the result has not changed.
cache.js
can help you by caching the result of the command to /tmp and returning the result
immediately.
from collections import defaultdict | |
import sys | |
from copy import deepcopy | |
def find_common_prefix(word1, word2): | |
"""Find the longest common prefix between two words""" | |
i = 0 | |
l1 = len(word1) | |
l2 = len(word2) | |
while l1 > i and l2 > i and word1[i] == word2[i]: |
function source_bash | |
exec /bin/bash -c "source $argv && exec fish" | |
end |
""" | |
Will render markdown to markdown. | |
Will execute execbash code blocks and add their output to the code block. | |
""" | |
import mistune | |
import sh | |
from textwrap import wrap |