Skip to content

Instantly share code, notes, and snippets.

tenomoto

Block or report user

Report or block tenomoto

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@tenomoto
tenomoto / install_owl_freebsd.md
Last active Aug 22, 2019
Install OCaml and Owl on FreeBSD
View install_owl_freebsd.md

This gist describes steps to install the latest version of OCaml and Owl on FreeBSD. Tested with FreeBSD 12.0-RELEASE-p9 on Hyper-V/Windows 10 Pro 1903.

Install opam

Install opam as described How to install opan. EDIT the first line may not work. Install opam with pkg.

sh <(curl -sL https://raw.githubusercontent.com/ocaml/opam/master/shell/install.sh)
opam init
eval $(opam env)
@tenomoto
tenomoto / units.markdown
Created Jul 12, 2019
Install R package units on Mac
View units.markdown
  • udunits2 is installed with MacPorts
$ curl -O https://mran.microsoft.com/snapshot/2018-08-01/src/contrib/units_0.6-0.tar.gz
$ sudo R CMD INSTALL units_0.6-0.tar.gz --configure-args='--with-udunits2-include=/opt/local/include/udunits2 --with-udunits2-lib=/opt/local/lib'
@tenomoto
tenomoto / nmdash.ahk
Created Feb 17, 2019
Send en- and em-dash
View nmdash.ahk
!-::Send {U+2013}
+!-::Send {U+2014}
@tenomoto
tenomoto / settings.py
Last active Dec 23, 2018
add password reset to django admin
View settings.py
# use console backend for development
# https://docs.djangoproject.com/en/2.1/ref/settings/#std:setting-EMAIL_BACKEND
# https://docs.djangoproject.com/en/2.1/topics/email/#django.core.mail.backends.smtp.EmailBackend
EMAIL_BACKEND = 'django.core.mail.backends.console.EmailBackend'
# use admin site to login
# https://docs.djangoproject.com/en/2.1/ref/settings/#std:setting-LOGIN_URL
LOGIN_URL = '/admin/'
@tenomoto
tenomoto / jrap_grib2nc.sh
Created Nov 9, 2018
Convert JMA Radar-AMeDAS in GRIB2 to netcdf
View jrap_grib2nc.sh
#!/bin/sh
yyyymmdd=20180701
hhmm=0000
fname=Z__C_RJTD_${yyyymmdd}${hhmm}00_RDR_JMAGPV__grib2
tar xf ${fname}.tar
wgrib2 ${fname%__grib2}_Ggis1km_Prr10lv_ANAL_grib2.bin -netcdf ${hhmm}.nc
@tenomoto
tenomoto / Animation.ipynb
Last active Oct 6, 2018
Animate pcolormesh and scatter
View Animation.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@tenomoto
tenomoto / add_read_permission.sh
Last active Oct 7, 2018
Add read permission to files and directories and execute only to directories
View add_read_permission.sh
# a: all
# =: reset
# r: read
# X: execute excluding files
# u: user (owner)
# +: add
# w: write
chmod -R a=rX,u+w directory
@tenomoto
tenomoto / cpuinfo.sh
Created Sep 28, 2018
Processor information of Mac
View cpuinfo.sh
# https://apple.stackexchange.com/questions/238777/how-do-i-identify-which-cpu-a-macbook-uses
sysctl -n machdep.cpu.brand_string
system_profiler SPHardwareDataType
@tenomoto
tenomoto / rotate.ncl
Created Feb 26, 2018
Calculate tangential and radial winds by locating the typhoon centre at the North Pole
View rotate.ncl
pi = acos(-1.0)
tau = 2 * pi
deg2rad = pi / 180.0
rad2deg = 180.0 / pi
procedure lonlat2xyz(lon, lat, x, y, z)
begin
x = cos(lon) * cos(lat)
y = sin(lon) * cos(lat)
z = sin(lat)
@tenomoto
tenomoto / .maintenance
Created Dec 24, 2017
Set WordPress into maintenance mode
View .maintenance
<?php
// https://wordpress.stackexchange.com/questions/211303/wp-cli-enabling-maintainance-mode
$upgrading = time();
You can’t perform that action at this time.