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
# Google Cloud Messaging demo server in python | |
import web # web.py lib | |
from gcm import GCM # https://github.com/geeknam/python-gcm | |
urls = ( | |
'/gcm-demo', 'index', | |
'/gcm-demo/register', 'register', | |
'/gcm-demo/unregister', 'unregister' | |
) |
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
// sumobot with two sonic sensors | |
#define START_WAIT 5000 // ms | |
#define jooksu_aeg 500 // how much to back away from white line (ms) | |
#define mootor OUT_BC // motors | |
#define light_threshold 40 // light threshold | |
#define otsingu_kaugus 30 // distance for enemy | |
#define attack_speed 100 // | |
#define left_light_port IN_4 // vasak ees valgus | |
#define right_light_port IN_1 // parem ees valgus |
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 | |
from twisted.python import log | |
from twisted.internet.protocol import Factory | |
from twisted.protocols.basic import NetstringReceiver | |
from twisted.internet import reactor | |
from uuid import uuid4 as get_uuid |
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
#!/bin/ash | |
#using: sendsms +375555555 "some text i want to send" | |
TELFNUMB=$1 | |
SMSTEXT=$2 | |
MODEM="/dev/ttyUSB1" | |
#reg to the network (maybe not needed) | |
gcom reg -d $MODEM |
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/sh | |
echo "Content-type: text/html" | |
echo "" | |
cat << 'EOF' | |
<!DOCTYPE html> | |
<html> | |
<head> | |
<title>Bootstrap 101 Template</title> | |
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | |
<!-- Bootstrap --> |
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 <[email protected]> ## | |
## LICENSE: WTFPL ## | |
################################################################################ |
OlderNewer