Skip to content

Instantly share code, notes, and snippets.


Quang-Linh LE linktohack

View GitHub Profile
linktohack / mod_fft.f90
Created April 19, 2013 22:13
Generate Frequency for FFT
View mod_fft.f90
function fftfreq(st, block)
implicit none
real*8, intent(in) :: st(:) ! sample time
integer, intent(in) :: block
real*8 :: fftfreq(size(st))
integer*4 :: n, i
real*8 :: t
linktohack / mod_io.f90
Created April 19, 2013 22:17
Load Text Data
View mod_io.f90
subroutine load_txt_data_1d_d(d, f)
implicit none
real*8, intent(out) :: d(:) ! array of text data
character(*), intent(in) :: f ! chanel file name
open(51, file=trim(f), status='old', action='read')
read(51, *) d
linktohack / mod_io.f90
Created April 19, 2013 22:17
Load Binary Data
View mod_io.f90
subroutine load_bin_data_1d_r(d, f)
implicit none
real*4, intent(out) :: d(:) ! array of binary data
character(*), intent(in) :: f ! chanel file name
integer*4 :: n
n = size(d)
open(51, file=trim(f), status='old', form='unformatted', &
linktohack / pressure.m
Created April 20, 2013 15:39
Plot chanel XX of config YY
View pressure.m
% Plot chanel 9 of config [5 6]
loglog(freqt(1:block/2), permute(x(1:block/2,9,[5 6]), [1,3,2]));
% Plot chanel [8 9 10] of config 6
loglog(freqt(1:block/2), x(1:block/2,[8 9 10],6));
linktohack / pressure.m
Created April 20, 2013 15:41
numpy Hanning Window
View pressure.m
% Hanning Windows
window = (0:block-1)'; %' Mwhaa Sublime :))
window = 0.5*(1-cos(2*pi*window/(block-1)));
linktohack / .vimrc
Created July 4, 2013 07:56
vim LaTeX forwad search
View .vimrc
" LaTeXForwadSearch {{{
function! LaTeXForwadSearch()
silent! execute '!"C:\Applications\SumatraPDF\SumatraPDF.exe -reuse-instance ' \
. expand('%:p:r') . '.pdf -forward-search ' . expand('%:p') . ' ' . line('.') . '"'
" This line is reverse search for SumatraPDF
"C:\Users\Link\Dropbox\Applications\Vim\gvim.exe" --remote-silent +"%l|norm zz" "%f"
" }}}
linktohack / gfortran_compiler_make.vim
Last active December 19, 2015 13:49
Vim gfortran error format
View gfortran_compiler_make.vim
set efm=%-Ggfortran%.%#,%A%f:%l:,%A%f:%l.%c:,%A%f:%l:,%C,%C%p%*[0123456789^],%Z%trror:\ %m,,%Z%tarning:\ %m,%C%.%#,%-Gmake%.%#
linktohack / subr
Created January 16, 2015 10:34
Download rmate as subr (and subl if not exist)
View subr
wget -O /usr/local/bin/subr
chmod +x /usr/local/bin/subr
if ! which subl 2>&1 > /dev/null; then
ln -s /usr/local/bin/subr /usr/local/bin/subl
linktohack / hackerWeb.js
Last active August 29, 2015 14:14
HackerWeb (bookmarklet) redirect for HackerNews frontend
View hackerWeb.js
javascript:(function hackerWeb (len) {
if (window.location.href.match('')) {
window.location.href = window.location.href.replace('', '');
} else {
var a = document.querySelectorAll('a');
if (len != a.length) {, function(e) {
var href = e.getAttribute('href');
href && e.setAttribute('href', href.replace('', ''));
linktohack / gender.txt
Last active August 29, 2015 14:15
Hao gender equality
View gender.txt
Emma Watson seems nervous at first, but I can see coherence in her speech. She starts with her own experience with her family, her school then her confession of a feminist with her male friend then to a bigger picture: Human rights, where people, men an women perceive the same rights, same opportunities in their life.
As she stated in her speech, no country at the moment achieves gender equality and it doesn't seem to change much from the talk of Hilary Clinton in 1997. She also mentions that it maybe due to the fact that there was too few men who participate the campaigns.
Having a look on the map of HeForShe, I found however, the more men's votes in US and Europe, the less votes on Africa. Is this the answer why do we have Angela Merkel as Chancellor of Germany or Marissa Mayer as CEO of Yahoo! when here are many women out there doing the job no men do in Jordan or even having no ID card in Guatemala?