Skip to content

Instantly share code, notes, and snippets.

View magicleon94's full-sized avatar

Antonello Galipò magicleon94

View GitHub Profile
@magicleon94
magicleon94 / TweetCleaner.py
Created September 4, 2016 08:29
Simple script to delete tweets that contain a specified text from your timeline
import tweepy
#put here your app token and secret
consumer_token = "XXXXXX"
consumer_secret = "XXXXXX"
auth = tweepy.OAuthHandler(consumer_token,consumer_secret)
try:
#If token values are available set them
@magicleon94
magicleon94 / bookingchallenge1.py
Created May 9, 2017 18:07
solution to the first quiz of the hacker rank challenge for booking.com job applying
# Enter your code here. Read input from STDIN. Print output to STDOUT
import sys
def isSquare(sides):
if len(sides)!=4:
return False
if sides[0]==sides[1] and sides[2]==sides[3] and sides[1]==sides[2]:
return True
return False
def isRectangle(sides):
@magicleon94
magicleon94 / count.sh
Created June 22, 2017 10:12
Count surrounding devices based on captured probe requests on Linux
#!/bin/bash
Red='\e[0;31m'
allowAbort=true;
exitHandler(){
if $allowAbort; then
echo "LULLOOOOOOOOOOOOOOOOOOOOOOOOO"
rm tmp count;
exit 1;
/* Simple program that detects if a string is an anagram of the other
* Author: Antonello Galipò
*/
#include <iostream>
#include <string>
#include <algorithm>
using std::sort;
using std::cout;
/*
* Author: Antonello Galipò
* Merge sort implementation in c++
*/
#include <iostream>
using std::cout;
using std::endl;
using std::string;
using std::memcpy;
@magicleon94
magicleon94 / renamer.sh
Created August 29, 2017 13:37
Renamer for TV series name with structure "Series Name Season XX Episode XX Title"
#!/bin/bash
seasonNo=$1
maxNo=$2
if [ "$#" -ne "2" ]; then
echo "Illegal number of parameters"
echo "Usage: $0 seasonNumber episodeNumber"
fi
#!/bin/python
import sys
if __name__ == "__main__":
n = int(raw_input().strip())
m = int(raw_input().strip())
grid = [[0 for k in range(n)] for i in range(n)]
@magicleon94
magicleon94 / CsvActionResult.cs
Created December 19, 2017 10:14 — forked from simonech/CsvActionResult.cs
ActionResult for ASP.NET MVC that returns a CSV file from any list of objects
using System;
using System.Collections.Generic;
using System.Data;
using System.IO;
using System.Reflection;
using System.Text;
using System.Web;
using System.Web.Mvc;
namespace webnetconf.website.Helpers
@magicleon94
magicleon94 / rotatingAltair.html
Last active January 31, 2018 21:56
Experimenting with THREE.js
<html>
<script src="three.js-master/build/three.js"></script>
<body>
</body>
<script>
var renderer;
var scene;
@magicleon94
magicleon94 / PepperLasers.py
Last active May 2, 2018 15:35
Pepper lasers
import qi
import time
import sys
import almath
from matplotlib import pyplot as plt
import math
import random
# robotIP = "150.145.115.50"