This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # See https://stackoverflow.com/a/14307477/3260253 | |
| git checkout main | |
| git pull --strategy=ours . release |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # See https://github.com/cihga39871/JobSchedulers.jl/blob/aca52de/src/jobs.jl#L6-L10 | |
| function generate_id() | |
| time_value = (now().instant.periods.value - 63749462400000) << 16 | |
| rand_value = rand(UInt16) | |
| time_value + rand_value | |
| end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import matplotlib.pyplot as plt | |
| import numpy as np | |
| import random | |
| # Generate random colors | |
| def random_color(): | |
| return [random.uniform(0, 1), random.uniform(0, 1), random.uniform(0, 1)] | |
| # Generate coordinates for small bubbles around a big bubble with a fixed distance | |
| def small_bubbles(x, y, radius, distance, num_bubbles, min_radius, max_radius): |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| dirs = FileNameJoin[{$HomeDirectory, $BasePacletsDirectory, | |
| "Repository", "*"}] // FileNames | |
| paclets = Map[StringSplit[FileNameSplit[#][[-1]], "-"][[1]] &, dirs] | |
| Map[PacletUninstall, paclets] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| \newcommand{\dif}{\ensuremath{\mathop{}\!\mathrm{d}}} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| \newcommand*{\tran}{^{\mkern-1.5mu\mathsf{T}}} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Usage: compresspdf [input file] [output file] [screen*|ebook|printer|prepress] | |
| compresspdf() { | |
| gs -sDEVICE=pdfwrite -dNOPAUSE -dQUIET -dBATCH -dPDFSETTINGS=/${3:-"screen"} -dCompatibilityLevel=1.4 -sOutputFile="$2" "$1" | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # See https://stackoverflow.com/a/69727920/3260253 | |
| git switch main # now you should be up to date with origin/main | |
| git merge --strategy=ours hotfix/1.1.1 # bring in commits without their changes! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| function mapat!(f, array, indices...) # Map function `f` at specific indices of an array | |
| area = view(array, indices...) | |
| map!(f, area, area) | |
| return array | |
| end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/perl | |
| use strict; | |
| use warnings; | |
| use File::Copy; # to copy the original file to backup (if overwrite option set) | |
| use Getopt::Std; # to get the switches/options/flags | |
| # get the options | |
| my %options=(); | |
| getopts("wos", \%options); |