Skip to content

Instantly share code, notes, and snippets.

View jossef's full-sized avatar
🌶️

Jossef Harush Kadouri jossef

🌶️
View GitHub Profile
package jossef.cli.mahout;
import au.com.bytecode.opencsv.CSVReader;
import com.google.common.collect.Lists;
import com.google.common.collect.Maps;
import java.io.FileReader;
import java.io.IOException;
import java.text.DateFormat;
http://stackoverflow.com/questions/23627796/closing-a-form-view/23632367#23632367
<Application x:Class="WpfApplication2.App"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
<Application.Resources>
</Application.Resources>
</Application>
@jossef
jossef / SassMeister-input.sass
Created July 17, 2014 13:12
Generated by SassMeister.com.
// ----
// Sass (v3.3.10)
// Compass (v1.0.0.alpha.20)
// ----
=draggable($is-draggable)
@if $is-draggable
cursor: move
@else
#!/usr/bin/python
# -*- coding: utf-8 -*-
import sqlite3 as lite
import sys
import datetime
import csv
import StringIO
import urlparse
@jossef
jossef / mailsender.py
Last active June 22, 2021 22:56
python gmail smtp mail sender with images
from email.mime.image import MIMEImage
import smtplib
from email.mime.multipart import MIMEMultipart
from email.mime.text import MIMEText
class MailSender(object):
def __init__(self, username, password, server='smtp.gmail.com', port=587, use_tls=True):
self.username = username
@jossef
jossef / arduino-upload.py
Last active August 29, 2015 14:12
Arduino firmware upload script using `Eclipse Arduino IDE` and `inotool`
#!/usr/bin/python
import os
import shutil
import subprocess
import tempfile
def get_hex_files():
for root, dirs, files in os.walk(os.getcwd()):
@jossef
jossef / md5_image_renamer.py
Last active August 29, 2015 14:12
python jpg files MD5 renamer
#!/bin/sh/ python
import os
import shutil
import hashlib
output_dir = '.'
for dirpath, dnames, fnames in os.walk("."):
for f in fnames:
full_path = os.path.join(dirpath, f)
@jossef
jossef / thumbnailer.py
Created January 3, 2015 09:25
python jpg thumbnail creator
import os
from PIL import Image
output_dir = '.\\output'
thumbnail_size = (200,200)
if not os.path.exists(output_dir):
os.makedirs(output_dir)
for dirpath, dnames, fnames in os.walk(".\\input"):
@jossef
jossef / gist:ab356497e0c78de2fc33
Created February 5, 2015 13:11
python subprocess with timeout
def call(command, timeout=60):
process = None
def target():
global process
process = subprocess.Popen(command)
process.communicate()
thread = threading.Thread(target=target)
thread.start()