Skip to content

Instantly share code, notes, and snippets.

#!/usr/bin/env python3
"""
Play a file continously, and exit gracefully on signal
Based on https://github.com/steveway/papagayo-ng/blob/working_vol/SoundPlayer.py
@author Guy Sheffer (GuySoft) <guysoft at gmail dot com>
"""
import signal
import time
@guysoft
guysoft / parse.py
Last active April 8, 2017 12:22
Parse arguments
a='base(octopi,a(b,c(a2)),mm)'
def parse(a):
stack=[]
token = ""
for char in a:
if char == "(":
stack.append(token)
if token != "":
--- Makefile.vc10.orig 2014-09-11 20:19:32.000000000 +0300
+++ Makefile.vc10 2014-10-21 14:59:35.573868800 +0300
@@ -114,7 +114,7 @@
## Release
CCR = cl.exe $(RTLIB) /O2 /DNDEBUG
-LINKR = link.exe /incremental:no /libpath:"../lib"
+LINKR = link.exe /incremental:no /libpath:"../lib" libssh2.lib libeay32.lib ssleay32.lib zlib.lib
RCR = rc.exe /dDEBUGBUILD=0
@guysoft
guysoft / email.py
Created August 7, 2014 14:02
send email
#!/usr/bin/python
import smtplib
import sys
import string
fromaddr = '<your gmail address>'
toaddrs = '<destination address>'
msg = sys.argv[1]
subject = "3D printer message"
@guysoft
guysoft / voting.m
Created January 22, 2013 15:18
Calculate a quick an dirty prediction for vote percentage in Israel 2013 elections
clear all
y1973= [21.8 33.1 41.4 54.1 65.2 73.4 78.6]'
y1977= [16.8 31.3 42.4 50.6 60.2 71.4 79.2]'
y1981= [17 30.2 39.4 47 57 69.6 78.5]'
y1984= [15.6 29.8 39.8 47.2 55.6 68.9 78.8]'
y1988= [14.8 29.3 42.1 52.9 65.2 75.6 79.7]'
y1992= [14 27.5 38.4 47 56.3 68.2 77.4]'
y1996= [14.3 28.9 41.3 50.6 60 70.9 79.3]'
y1999= [14.2 28.9 41.7 51.8 60.9 71.4 78.7]'
y2003= [10.1 24 35.3 44.2 52.8 62.8 67.8]'
@guysoft
guysoft / pidginAutoAway.sh
Last active October 11, 2015 03:18
A simple script that makes pidgin go automaticly idle away when AFK (uses xprintidle and purple-remote)
#!/bin/bash
#Simple pidgin Auto-Away
#By Guy Sheffer (GuySoft) <guysoft at gmail dot com>
#Set time
IDLE_TIME_MIN=15
FIX=60000
#SHIFT=16200000
SHIFT=0