Skip to content

Instantly share code, notes, and snippets.

View ryokbys's full-sized avatar

RYO KOBAYASHI ryokbys

View GitHub Profile
@ryokbys
ryokbys / correct-md.py
Created January 10, 2022 08:42
Correct frontmatter of .md files in the given DIR converted from .rst files using pandoc.
#!/usr/bin/env python
"""
Correct frontmatter of MD files in the given DIR converted from rst files using pandoc..
Usage:
correct-md.py [options] DIR
Options:
-h, --help Show this message and exit.
"""
@ryokbys
ryokbys / myblog.py
Last active December 22, 2017 08:47
Blog post generation and make for Pelican static blog generator.
#!/usr/bin/env python
# -*- coding: utf-8 -*-
'''
This creates blog post file for Pelican at the directory in the year
and month of the current date as ``content/yyyy/mm/dd_slug.[md|rst]`` .
This should be run at the directory that includes ``content`` directory.
Usage:
myblog.py post [options] TITLE
myblog.py notebook [options] NOTEBOOK
@ryokbys
ryokbys / ga.py
Created January 11, 2016 09:10
Genetic algorithm python program.
#!/usr/bin/env python
"""
Genetica algorithm module.
Usage:
ga.py [options]
Options:
-h, --help Show this message and exit.
"""
@ryokbys
ryokbys / sa.py
Last active January 6, 2018 14:43
Simulation annealing implemented in python.
#!/usr/bin/env python
"""
Simulated annealing module.
Usage:
sa.py [options]
Options:
-h, --help Show this message and exit.
"""
@ryokbys
ryokbys / .bashrc
Last active February 28, 2016 22:13
Create a blog post for Pelican, which is a static blog system. Note other than Mac, comment out the line 78.
alias post='create_post.py --basedir="/path/to/pelican/" -a "Author name"'
@ryokbys
ryokbys / gist:152aa70589015226ccc9
Last active August 29, 2015 14:11
Gaussian smearing script for 1D data.
#!/bin/env python
"""
Smear 1D data of equidistance intervals with Gaussians.
"""
import os,sys,math
import optparse
usage= '%prog [options] datafile'