Skip to content

Instantly share code, notes, and snippets.

View papachristoumarios's full-sized avatar

Marios Papachristou papachristoumarios

View GitHub Profile
@papachristoumarios
papachristoumarios / anonymize.sh
Last active February 6, 2024 10:45
Anonymize source code for blind review paper submission with sed
#!/bin/bash
# Anonymization of source code for blind review paper submission
# using sed to replace words with XXX. It also removes the .git
# directory in the anonymized project to avoid exposing any
# sensitive information about the author(s).
#
# Usage: anonymize.sh /path/to/project words_to_anonymize.txt
# words_to_anonymize.txt contains a word in each line
#
@papachristoumarios
papachristoumarios / ply_plotter.py
Created March 12, 2017 15:50
A simple PLY pointcloud plotter in Python with matplotilib and numpy
from mpl_toolkits.mplot3d import Axes3D
import matplotlib.pyplot as plt
import numpy as np
def get_pts(infile):
data = np.loadtxt(infile, delimiter=',')
return data[12:,0], data[12:,1], data[12:,2] #returns X,Y,Z points skipping the first 12 lines
def plot_ply(infile):
@papachristoumarios
papachristoumarios / git-lfs-sync.sh
Created October 7, 2019 15:07
Git LFS Sync between remotes
#!/bin/bash
# Sync two git LFS remotes. This is very useful when you
# have two remotes (e.g. upstream and fork) and they have
# different files on the LFS storage. Trying git lfs fetch --all
# yields an error for missing objects if the two repos are not
# synced. The purpose of this script is to overcome this issue
# with Git LFS
#
# Usage: git-lfs-sync.sh source destination branch
#
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
\ProvidesPackage{latex-macros}
% Require packages
\RequirePackage{amsmath,amssymb,amsthm}
\RequirePackage{bm,bbm}
\RequirePackage{hyperref}
% mathbb letters
\newcommand{\Abb}{\mathbb{A}}
%\newcommand{\Bbb}{\mathbb{B}}
@papachristoumarios
papachristoumarios / communities.sql
Created April 7, 2021 01:36
Attributed Github Dataset
--- find programming languages a user has been using (only as an owner)
--- contains 19M rows 10M of them are not NULL
select user_id, group_concat(org_id order by org_id separator ',')
from organization_members
group by user_id;
@papachristoumarios
papachristoumarios / to_directed.sh
Created March 29, 2020 11:10
Convert undirected edgelist to directed with awk
#!/bin/bash
awk '{print $2 " " $1}' $1 >$1_rev
cat $1 $1_rev >$1_merged
@papachristoumarios
papachristoumarios / .travis.yml
Created August 14, 2019 11:31
Travis auto build LaTeX PDFs
sudo: required
dist: trusty
before_install:
- sudo apt-get -qq update && sudo apt-get install -y --no-install-recommends texlive-fonts-recommended texlive-latex-extra texlive-fonts-extra dvipng texlive-latex-recommended
script:
- pdflatex -interaction=nonstopmode -halt-on-error -output-directory cv/ cv/cv.tex
- git config --global user.email "papachristoumarios@gmail.com"
- git config --global user.name "Marios Papachristou"
- git commit -am 'Auto build CV'
# Setup GH_TOKEN as an environment variable for Travis CI from Github to match your API Token
@papachristoumarios
papachristoumarios / build.sh
Created August 3, 2019 15:53
Build LaTeX files fast
#!/bin/bash
# Usage: build.sh filename (without .tex extension)
pdflatex -interaction=nonstopmode -halt-on-error $1.tex &&
bibtex $1.aux &&
pdflatex -interaction=nonstopmode -halt-on-error $1.tex &&
pdflatex -interaction=nonstopmode -halt-on-error $1.tex
@papachristoumarios
papachristoumarios / download_gdrive.sh
Created July 24, 2019 15:20
Download from Google Drive via terminal
#!/bin/bash
# Usage download_gdrive.sh file_id outfile
CONFIRM=$(wget --quiet --save-cookies /tmp/cookies.txt --keep-session-cookies --no-check-certificate "https://docs.google.com/uc?export=download&id=$1" -O- | sed -rn 's/.*confirm=([0-9A-Za-z_]+).*/\1\n/p')
wget --load-cookies /tmp/cookies.txt "https://docs.google.com/uc?export=download&confirm=$CONFIRM&id=$1" -O $2
rm -rf /tmp/cookies.txt