Skip to content

Instantly share code, notes, and snippets.

View zzj99's full-sized avatar

Zhijun Zhang zzj99

  • Peking University
  • Beijing
View GitHub Profile
@zzj99
zzj99 / git_cmd.md
Created April 6, 2016 15:46
git commands

add file

$ git add 'myFile.html'
$ git commit -m 'add myFile.html'
$ git push

delete file/folder

$ git rm 'myFile.html'
@zzj99
zzj99 / test.c
Last active April 9, 2016 08:07
Fortran call C, deal with double**
#include <stdio.h>
#include <math.h>
#include <stdlib.h>
/* This is a C function to be called from Fortran
* input s: the size of the array
* output x: the array of float point numbers in double precision
*/
void call_fc(double *(*x), int s)
{
@zzj99
zzj99 / 0_reuse_code.js
Created April 7, 2016 09:14
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
@zzj99
zzj99 / git_create.sh
Last active April 9, 2016 14:51
git create repository, replace USER, REPO with corresponding name
mkdir REPO
cd REPO
git init
git remote add origin git@github.com:USER/REPO.git
git add .
git commit
git push origin master
@zzj99
zzj99 / g09results.f90
Created April 9, 2016 13:59
get G09 results, e.g. HF=xxxxxx
program test
implicit none
character(len=40) :: infile ! length of file name should be <= 40
character(len=1050) :: results ! assume the results text is no longer than 15 lines
real(8) :: eHF
integer :: idHF
infile="c2min-energy.log" ! log file for test
call g09results(infile, results)
@zzj99
zzj99 / binary.f90
Created May 28, 2016 13:51
read unformatted / binary fortran file with python
program test
integer :: i
open(1, file='test.dat', access='stream', form='unformatted')
do i = 1, 10
write(1) i
write(1) dble(i)**2
end do
close(1)
end program test