Skip to content

Instantly share code, notes, and snippets.

Nikolaos Georgiou ngeor

Block or report user

Report or block ngeor

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
@ngeor
ngeor / update_jacoco.py
Last active Jul 12, 2019
Update jacoco coverage thresholds in pom.xml
View update_jacoco.py
'''
Updates the jacoco thresholds in pom.xml based on the reports.
'''
from os.path import join
import lxml.etree as ET
def write(file, tree):
'''
@ngeor
ngeor / index.js
Created Dec 29, 2018
bitbucket-hipchat-pr-notifier
View index.js
/* eslint-disable max-lines */
const request = require('request');
const Promise = require('promise');
const AWS = require('aws-sdk');
const encryptedPassword = process.env.BITBUCKET_PASSWORD;
let decryptedPassword;
const minSuccess = 200;
const maxSuccess = 300;
@ngeor
ngeor / csharp.json
Last active Jan 18, 2019
Visual Studio Code Snippets
View csharp.json
{
/*
// Place your snippets for C# here. Each snippet is defined under a snippet name and has a prefix, body and
// description. The prefix is what is used to trigger the snippet and the body will be expanded and inserted. Possible variables are:
// $1, $2 for tab stops, $0 for the final cursor position, and ${1:label}, ${2:another} for placeholders. Placeholders with the
// same ids are connected.
// Example:
"Print to console": {
"prefix": "log",
"body": [
@ngeor
ngeor / convert.sh
Last active Sep 1, 2018
Convert video files with ffmpeg, delete original if new file size is smaller
View convert.sh
#!/bin/bash
# try combining with find . -type f -size +6G -not iname "*.mp4"
FILE="$1"
if [ ! -r "$FILE" ]; then
echo "Error: File $FILE not found"
exit 1
fi
NEW_FILE=$(echo "$FILE" | sed -r 's/\.[A-Za-z0-9]+$/.mp4/')
@ngeor
ngeor / zfs-snapshot.sh
Created Aug 3, 2017
bash script to take a zfs snapshot with a timestamp as the name
View zfs-snapshot.sh
#!/bin/sh
# put zfs on the path
PATH=$PATH:/sbin
# takes a snapshot on the given filesystem
# the snapshot name is the current date
SNAPSHOT_NAME=`date +%Y%m%d%H%M%S`
@ngeor
ngeor / Makefile
Created Jan 31, 2016
wxWidgets Hello World, with Linux Makefile and Visual Studio project for Windows
View Makefile
all: wxhelloworld
wxhelloworld: wxhelloworld.cpp
g++ -std=c++0x -o wxhelloworld wxhelloworld.cpp `wx-config --cppflags --libs`
@ngeor
ngeor / FolderWatch.cs
Created Jan 31, 2016
Watches a folder for changes and runs a command when changes occur. Needs Mono.Options for parsing command line.
View FolderWatch.cs
using System;
using System.Reflection;
using System.IO;
using System.Diagnostics;
using Mono.Options;
namespace FolderWatch
{
public class Program
{
@ngeor
ngeor / deleteoldtweets.py
Created Jan 31, 2016
Using tweepy to delete old tweets
View deleteoldtweets.py
#!/usr/local/bin/python
import sys
import time
import tweepy
consumer_key = "?"
consumer_secret = "?"
access_token_key = "?"
access_token_secret = "?"
auth = tweepy.OAuthHandler(consumer_key, consumer_secret)
@ngeor
ngeor / FriendsRenamerWikipedia.cs
Created Jan 31, 2016
The one where I use wikipedia to organize Friends episodes on disk
View FriendsRenamerWikipedia.cs
using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Text;
using System.Threading.Tasks;
using HtmlAgilityPack;
using System.Text.RegularExpressions;
using System.IO;
@ngeor
ngeor / fix-img-date.py
Created Jan 30, 2016
python script to repair EXIF dates based on filename
View fix-img-date.py
import sys
import os.path
import re
import os
# powershell tip:
# ls IMG* | % { python .\fix-img-date.py $_ }
def change_date(filename, date):
cmdline = "exiftool -AllDates=" + date + " \"" + filename + "\""
You can’t perform that action at this time.