Skip to content

Instantly share code, notes, and snippets.

View xigrug's full-sized avatar

liuc xigrug

  • Beijing
View GitHub Profile
@ppanyukov
ppanyukov / combinePdfFiles.tex
Created June 20, 2011 12:30
Combine several PDF files into one using LaTeX
% Many a time we have HTML articles published across multiple pages.
% And sometimes we want to print all those pages as one PDF.
% Here is how to do it:
% - Print into PDF from the browser into files like p01.pdf, p02.pdf etc
% - Use LaTeX to assemble these into one PDF.
%
% Here is the example. The \includepdf command supports scaling too,
% and I'm sure some other interesting commands as well.
%
% [copylifted from: http://yusung.blogspot.com/2007/02/combine-several-pdf-files-using-latex.html]
@joelverhagen
joelverhagen / README.md
Created February 12, 2012 02:14
Jekyll YouTube Embed Plugin

This is a plugin meant for Jekyll.

Example use:

Easily embed a YouTube video. Just drop this file in your _plugins directory.

{% youtube oHg5SJYRHA0 %}
@ycopin
ycopin / taylorDiagram.py
Last active August 9, 2024 14:25
Taylor diagram for python/matplotlib [ 10.5281/zenodo.5548061 ]
#!/usr/bin/env python
# Copyright: This document has been placed in the public domain.
"""
Taylor diagram (Taylor, 2001) implementation.
Note: If you have found these software useful for your research, I would
appreciate an acknowledgment.
"""
@agstudy
agstudy / gist:5013606
Last active June 27, 2019 04:56
add division to the calendar.
calendar.division <- function(...)
{
xyetc <- list(...)
subs <- dat[xyetc$subscripts,]
dates.fsubs <- dat[dat$yr == unique(subs$yr),]
y.start <- dates.fsubs$dotw[1]
y.end <- dates.fsubs$dotw[nrow(dates.fsubs)]
dates.len <- nrow(dates.fsubs)
adj.start <- dates.fsubs$woty[1]
@Yexiaoxing
Yexiaoxing / README.md
Last active June 26, 2018 03:49
Plugin for Jekyll to insert videos from Youku or Tudou.

这是一个用于Jekyll的youku、tudou嵌入插件。

This is a plugin meant for Jekyll.

用例:

Example use:

将youku.rb和/或tudou.rb文件拷贝至_plugins目录下,然后在文章中输入以下代码即可嵌入。

@urschrei
urschrei / basemap_descartes.py
Last active November 6, 2020 02:49
How to plot Shapely Points using Matplotlib, Basemap, and Descartes
"""
required packages:
numpy
matplotlib
basemap: http://matplotlib.org/basemap/users/installing.html
shapely: https://pypi.python.org/pypi/Shapely
descartes: https://pypi.python.org/pypi/descartes
random
@gizmaa
gizmaa / Plot_Examples.md
Last active October 27, 2024 12:01
Various Julia plotting examples using PyPlot
@wladston
wladston / distcorr.py
Last active August 29, 2024 17:28
Distance correlation with p-value
from scipy.spatial.distance import pdist, squareform
import numpy as np
import copy
def distcorr(Xval, Yval, pval=True, nruns=500):
""" Compute the distance correlation function, returning the p-value.
Based on Satra/distcorr.py (gist aa3d19a12b74e9ab7941)
>>> a = [1,2,3,4,5]
@ajdawson
ajdawson / LambertConformalTicks.ipynb
Last active June 7, 2022 13:47
Adding gridline labels to a cartopy Lambert Conformal projection plot
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@celoyd
celoyd / hi8-anim-howto.md
Last active August 1, 2022 15:37
A way to make Himawari-8 animations

Himawari-8 animation tutorial

Here’s how to make animations like this one. It requires intermediate Unix command-line knowledge, to install some tools and to debug if they don’t work. You’ll need these utilities:

  • curl (or you can translate to wget)
  • convert and montage, part of ImageMagick
  • ffmpeg, plus whatever codecs
  • parallel, for iteration that’s nicer than shell for loops or xargs
  • run everything in zsh for leading 0s in numerical ranges to work