This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python2 | |
# -*- coding: utf-8 -*- | |
#LICENSE: WTFPL | |
#DEPENDS: on this cool font from http://asdasd.rpg.fi/~svo/glasstty/ | |
#TODO: port to Python3 | |
from time import sleep | |
from sys import stdout |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python2 | |
# -*- coding: utf-8 -*- | |
from __future__ import print_function | |
num = raw_input("enter positive even number: ") | |
num = int(num) | |
result = 2 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/python | |
import RPi.GPIO as GPIO | |
from time import sleep | |
class HD44780: | |
def __init__(self, pin_rs=7, pin_e=8, pins_db=[25, 24, 23, 18]): | |
self.pin_rs=pin_rs |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/python2 | |
from math import sin, cos | |
from sdl2 import SDL_QUIT, SDL_MOUSEMOTION, SDL_MOUSEWHEEL | |
import sdl2.ext as sdl2ext | |
from sys import stdout | |
import time | |
BLACK = sdl2ext.Color(0, 0, 0) | |
WHITE = sdl2ext.Color(255, 255, 255) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/python2 | |
################################################################################ | |
## Automatic screenshot uploader ## | |
## ## | |
## WARNING, CONTAINS BAD CODE ## | |
## AND SECURITY HOLES! ## | |
## ## | |
## AUTHOR: Arti Zirk <arti.zirk@gmail.com> ## | |
## LICENSE: WTFPL ## | |
################################################################################ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<meta charset="utf-8"> | |
<link rel="stylesheet" href="http://cmx.io/v/0.1/cmx.css"/> | |
<script src="http://cmx.io/v/0.1/cmx.js"></script> | |
<body> | |
<scene id="scene1"> | |
<label t="translate(0,346)"> | |
<tspan x="0" y="0em">I'm awesome</tspan> | |
</label> | |
<actor t="translate(131,49)" pose="-11,9|-5,117|-11,99|-11,89|-11,79|-11,59|-16,34|-21,9|-6,34|-1,9|-18,79|-18,59|2,90|16,87"> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
echo "[`date`][Start] Host alive tester" | |
host_ip_addr="192.168.10.100" | |
alive_history=() | |
alive_history_size=5 | |
while true; do | |
#ping -nqc1 $host_ip_addr &> /dev/null #ping not good because cant set timeout time |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python3 | |
####################### | |
# | |
# Auto scroll while holding down mouse side buttons | |
# | |
# | |
from pymouse import PyMouse | |
from pymouse import PyMouseEvent | |
import threading |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function Obj() { | |
console.log("obj init"); | |
this.bs(); | |
} | |
Obj.prototype.bs = function() { | |
console.log("this is bs"); | |
}; | |
var obj = new Obj(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
old_dpms="" | |
while true; do | |
dpms=$(xset -q|grep Monitor|awk '{print $3;}') | |
if [ "$dpms" != "$old_dpms" ]; then | |
old_dpms=$dpms | |
if [ "$dpms" == "Off" ]; then | |
echo "Puting keyboard and mouse to sleep" | |
echo auto | sudo tee /sys/bus/usb/devices/3-13/power/control | |
echo auto | sudo tee /sys/bus/usb/devices/3-14/power/control |