Skip to content

Instantly share code, notes, and snippets.

View guziy's full-sized avatar
🇺🇦
#StandWithUkraine

Oleksandr Huziy guziy

🇺🇦
#StandWithUkraine
View GitHub Profile
# check the current layout settings
localectl status
# System Locale: LANG=en_CA.UTF-8
# VC Keymap: ca-multix
# X11 Layout: ca
# X11 Model: apple
# X11 Variant: multix
# the command to set keyboard layout is
FUNCTION inpoly_complex2(x,y,n,xx,yy)
!-------------------------------------------------------------------------------
! Determines if a point xx,yy is inside a complex polygon
! defined by x(n),y(n),
! ref : https://wrfranklin.org/Research/Short_Notes/pnpoly.html
!
!-------------------------------------------------------------------------------
implicit none
! arguments
integer n
program main
implicit none
interface
subroutine to_be_called(arg, nx, ny, arr)
integer :: arg, nx, ny
integer, allocatable, intent(out) :: arr(:, :)
@guziy
guziy / phy_542.py
Last active January 15, 2019 06:15
import sys
import math
g = 9.8
r = 6400e3
# problem 5.42 from Savchenko
def e0(v):
# total energy
# Calculate an average time for a maestro task, using ksh and logs stored in the stats folder
grep surge_run *_avg | grep -P -o 'EXECTIME=\K\d+:\d+:\d+' | xargs -I % ksh -c 'h=$(echo % | cut -d ":" -f 1);m=$(echo % | cut -d ":" -f 2);s=$(echo % | cut -d ":" -f 3); echo $(((h * 3600 + m * 60 + s)/60.))' | awk 'BEGIN{s=0;}{s+=$1;}END{print s/NR;}'
%% Inspired from http://www.texample.net/tikz/examples/circular-arrows-text/
\PassOptionsToPackage{dvipsnames}{xcolor}
\documentclass[tikz,border=10pt]{standalone}
\usetikzlibrary{decorations.text}
\usepackage{libertine}
#!/bin/bash
# save the listing into an array
z=($(ls -a))
# loop through the array elements and print the sizes (skip the "." and "..")
for zi in ${z[@]:2}; do
du -sh ${zi}
done
#! /bin/bash
# exit on error
set -e
the_list=($( port installed | grep -v active | grep -v : ))
size=${#the_list[@]}
let size=$size-1
echo $size
@guziy
guziy / init.coffee
Created January 26, 2016 16:55
Custom initialization for fortran files in Atom
# Your init script
#
# Atom will evaluate this file each time a new window is opened. It is run
# after packages are loaded/activated and after the previous editor state
# has been restored.
#
# An example hack to log to the console when each text editor is saved.
#
# atom.workspace.observeTextEditors (editor) ->
# editor.onDidSave ->
@guziy
guziy / .gitconfig
Last active August 29, 2015 14:26
git global configuration
# This is Git's per-user configuration file.
[user]
# Please adapt and uncomment the following lines:
name = Oleksandr Huziy
email = [email protected]
[push]
default = simple
[alias]
s = status -s
lg = log --oneline --decorate --all --graph