Skip to content

Instantly share code, notes, and snippets.

View arianpasquali's full-sized avatar

Arian Pasquali arianpasquali

  • Brussels, Belgium
View GitHub Profile
@johnnypea
johnnypea / useful-one-liners.sh
Last active April 22, 2024 14:56
Useful one liners
# Run the last command as root
sudo !!
# Serve current directory tree at http://$HOSTNAME:8000/
python -m SimpleHTTPServer
# Save a file you edited in vim without the needed permissions
:w !sudo tee %
# change to the previous working directory
cd -
# Runs previous command but replacing
^foo^bar
@aparrish
aparrish / understanding-word-vectors.ipynb
Last active May 22, 2024 14:36
Understanding word vectors: A tutorial for "Reading and Writing Electronic Text," a class I teach at ITP. (Python 2.7) Code examples released under CC0 https://creativecommons.org/choose/zero/, other text released under CC BY 4.0 https://creativecommons.org/licenses/by/4.0/
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@aparrish
aparrish / spacy_intro.ipynb
Last active August 9, 2023 01:41
NLP Concepts with spaCy. Code examples released under CC0 https://creativecommons.org/choose/zero/, other text released under CC BY 4.0 https://creativecommons.org/licenses/by/4.0/
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@adewes
adewes / README.md
Last active February 13, 2024 16:39
Ebay Ads - Bot. Because who wants to write messages by hand...

To use this bot:

  • Download ads_bot.py and requirements.txt.
  • Type pip install -r requirements.txt to install the requirements.
  • Fill out the required information in the Python file.
  • Ideally, create a (free) Slack account and set up a web hook to receive notifications from the bot.
  • Run the script :)
  • Relax and be ready to answer incoming calls :D
@psorianom
psorianom / text.py
Created August 23, 2014 13:40
Text feature extractor with okapi bm25 and delta idf
# -*- coding: utf-8 -*-
# Authors: Olivier Grisel <olivier.grisel@ensta.org>
# Mathieu Blondel <mathieu@mblondel.org>
# Lars Buitinck <L.J.Buitinck@uva.nl>
# Robert Layton <robertlayton@gmail.com>
# Jochen Wersdörfer <jochen@wersdoerfer.de>
# Roman Sinayev <roman.sinayev@gmail.com>
#
# License: BSD 3 clause
"""
@vunb
vunb / ffmpeg-convert-mp3-to-wave
Created November 7, 2013 04:52
Convert mp3 to wave format using ffmpeg
ffmpeg -i input.mp3 -acodec pcm_s16le -ac 1 -ar 16000 output.wav
# To convert all mp3 files in a directory in Linux:
for f in *.mp3; do ffmpeg -i "$f" -acodec pcm_s16le -ac 1 -ar 16000 "${f%.mp3}.wav"; done
# Or Windows:
for /r %i in (*) do ffmpeg -i %i -acodec pcm_s16le -ac 1 -ar 16000 %i.wav
@gustavohenrique
gustavohenrique / elementaryos-postinstall
Created October 31, 2013 14:54
Post installation of Elementary OS
First update:
sudo apt-get update && sudo apt-get upgrade
Kernel updates:
sudo apt-get install linux-generic-lts-raring
Essential:
sudo apt-get install build-essential ubuntu-restrict-extras devede winff k3b libavformat-extra-53 libavcodec-extra-53 tomboy vlc audience etube foto gazette faac faad ffmpeg ffmpeg2theora flac icedax id3v2 lame libflac++6 libjpeg-progs libmpeg3-1 mencoder mjpegtools mp3gain mpeg2dec mpeg3-utils mpegdemux mpg123 mpg321 regionset sox uudeview vorbis-tools x264 dconf-editor dconf-tools wingpanel-slim soundconverter gstreamer0.8-plugins gstreamer0.8-mad gstreamer0.8-lame gwenview pinta indicator-synapse vim-gtk tree aria2 links2 gimp unzip msttcorefonts openjdk-6-jdk
Developer:
#!/bin/bash
# Usage: ./deleteOld "bucketname" "30 days"
s3cmd ls s3://$1 | while read -r line;
do
createDate=`echo $line|awk {'print $1" "$2'}`
createDate=`date -d"$createDate" +%s`
olderThan=`date -d"-$2" +%s`
if [[ $createDate -lt $olderThan ]]
@jobliz
jobliz / RedisPythonPubSub1.py
Created May 4, 2012 17:58
A short script exploring Redis pubsub functions in Python
import redis
import threading
class Listener(threading.Thread):
def __init__(self, r, channels):
threading.Thread.__init__(self)
self.redis = r
self.pubsub = self.redis.pubsub()
self.pubsub.subscribe(channels)
@vgoklani
vgoklani / expand_url.py
Created February 13, 2012 00:08
Expand shortened URLs in Python
# http://stackoverflow.com/questions/748324/python-convert-those-tinyurl-bit-ly-tinyurl-ow-ly-to-full-urls
#############
# urllib2
import urllib2
fp = urllib2.urlopen('http://bit.ly/rgCbf')
fp.geturl()
# ==> 'http://webdesignledger.com/freebies/the-best-social-media-icons-all-in-one-place'