Skip to content

Instantly share code, notes, and snippets.

View amoodie's full-sized avatar

Andrew Moodie amoodie

View GitHub Profile
@kemingy
kemingy / auto_deploy_docs.md
Last active March 21, 2020 21:19
Auto deploying docs to GitHub Pages with Travis CI

Auto-Deploying Documents to GitHub Pages with Travis CI

There is already some gists talks about this topic using bash. However, Travis now support deploy in .travis.yml , which is super easy to set up. (Deploying to GitHub Pages is experimental now [2018.07.25])

I will show you an example of Python & Sphinx.

Create .travis.yml File

Here is a python example.

#!/usr/bin/env python3
from PIL import Image
import numpy as np
import tensorflow as tf
import tensorflow_hub as hub
# smooth values from point a to point b.
STEPS = 100
pt_a = np.random.normal(size=(512))
@TheoChristiaanse
TheoChristiaanse / TDMAsolver.py
Last active November 15, 2021 14:19 — forked from cbellei/TDMAsolver.py
Tridiagonal Matrix Algorithm solver in Python. I've modified the code from cbellei so, it works with python 3.0+ and implemented the use of jit to increase the speed.
import numpy as np
from numba import jit, f8
## Tri Diagonal Matrix Algorithm(a.k.a Thomas algorithm) solver
@jit(f8[:] (f8[:],f8[:],f8[:],f8[:] ))
def TDMAsolver(a, b, c, d):
'''
TDMA solver, a b c d can be NumPy array type or Python list type.
refer to http://en.wikipedia.org/wiki/Tridiagonal_matrix_algorithm
and to http://www.cfd-online.com/Wiki/Tridiagonal_matrix_algorithm_-_TDMA_(Thomas_algorithm)
@ankurk91
ankurk91 / bash_profile.md
Last active October 22, 2023 12:16
:octocat: Git branch name in Linux/Mac Bash Terminal

Mac OS : Show your git branch name on your bash terminal

⚠️ Does not work in zsh terminal

Add these lines in your ~/.bash_profile file

# Show current git branch name
parse_git_branch() {
     git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/ (\1)/'
}
@rowanc1
rowanc1 / syntheticSeismogram.py
Created January 9, 2014 17:52
Generates a synthetic seismogram for a simple 1-D layered model.
import numpy as np
import matplotlib.pyplot as plt
def syntheticSeismogram(v, rho, d):
"""
function syntheticSeismogram()
syntheicSeismogram generates a synthetic seismogram for a simple 1-D
@vitobotta
vitobotta / Importing posts from Wordpress into Jekyll.rb
Created March 26, 2011 22:50
The script I used to import posts from my Wordpress blog into a new Jekyll one.
%w(rubygems sequel fileutils yaml active_support/inflector).each{|g| require g}
require File.join(File.dirname(__FILE__), "downmark_it")
module WordPress
def self.import(database, user, password, table_prefix = "wp", host = 'localhost')
db = Sequel.mysql(database, :user => user, :password => password, :host => host, :encoding => 'utf8')
%w(_posts _drafts images/posts/featured).each{|folder| FileUtils.mkdir_p folder}