Skip to content

Instantly share code, notes, and snippets.

Fotis Gimian fgimian

Block or report user

Report or block fgimian

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
fgimian / parameter-issue.ps1
Created Jun 5, 2019
How can I allow parameter sets to be optional? :)
View parameter-issue.ps1
function Install-File {
param (
[Parameter(Mandatory=$true, Position=0)][string]$Path,
# ...
#!/usr/bin/env python3
Trash Locations shows you all deleted files and their original location (sorted by original
To run this script, you'll first need to install Python 3.6 or later and run:
pip3 install ds_store
Developed by Fotis Gimian (MIT license).
fgimian / slack_delete.rb
Created May 30, 2018 — forked from jamescmartinez/slack_delete.rb
This Ruby script will bulk remove all Slack files older than 30 days. Just add your API token from into the token quotes at the top of the file.
View slack_delete.rb
require 'net/http'
require 'json'
require 'uri'
@token = ''
def list_files(days)
params = {
token: @token,
ts_to: ( - days * 24 * 60 * 60).to_i,
fgimian /
Created May 28, 2018
The following Crystal code attempts to implement custom YAML tag processing
require "yaml"
# The default representation of null values in Crystal is an empty value which while valid
# (see but is less familiar and clear to me, use the string
# "null" instead
struct Nil
def to_yaml(yaml : YAML::Nodes::Builder)
yaml.scalar "null"
View prospector.yaml
# Ensure very detailed checking with no exclusions
strictness: veryhigh
doc-warnings: true
member-warnings: true
test-warnings: true
# Set maximum line length across linters to the agreed length
max-line-length: 100
import math
import sys
import time
# Colours
BOLD = '\033[1m'
RED = '\033[91m'
GREEN = '\033[92m'
YELLOW = '\033[93m'
# Generate a file containing all URLs for Logic Pro X content
curl -s | \
grep -B 1 DownloadSize | grep "<string>" | sed -e "s:.*<string>::" -e "s:</string>.*::" | \
sed "s;^;;" > logic-pro-x-download-urls-2016.txt
# After generating the output file logic-pro-x-download-urls-2016.txt, I recommend opening it with Firefox
# and using DownloadThemAll to download all the URLs.
# When the downloads are complete, you may automatically install packages as follows
sudo -v
#!/usr/bin/env perl
# Trash Locations shows you all deleted files and their original location (sorted by original
# location).
# To run this script, you'll first need to run:
# brew install perl
# cpan Mac::Finder::DSStore
fgimian /
Last active Nov 21, 2016
A simple little script to run on macOS to test stability of your internet connection
# Set the destination IP or hostname to ping
# Ping the endpoint and write an error to a log file if the ping fails 5 times consecutively
while true
ping -c 1 -t 1 $DESTINATION > /dev/null 2>&1
fgimian /
Created Aug 21, 2016
Red Hat Satellite Dynamic Inventory for Ansible
#!/usr/bin/env python
# Red Hat Satellite Dynamic Inventory for Ansible
# Copyright 2016 by Fotis Gimian (MIT License)
# Set your inventory to point to this script and ensure the script is
# executable. You'll need an INI file with Satellite details of the following
# style (whereby you may specify one or more Satellite servers):
# [satellite]
You can’t perform that action at this time.