Skip to content

Instantly share code, notes, and snippets.

@koo5
Created April 27, 2012 05:14
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save koo5/2506078 to your computer and use it in GitHub Desktop.
Save koo5/2506078 to your computer and use it in GitHub Desktop.
meow
--[[
Background by londonali1010 (2009)
This script draws a background to the Conky window. It covers the whole of the Conky window, but you can specify rounded corners, if you wish.
To call this script in Conky, use (assuming you have saved this script to ~/scripts/):
lua_load ~/.scripts/draw_bg.lua
lua_draw_hook_pre draw_bg
Changelog:
+ v1.0 -- Original release (07.10.2009)
]]
-- Change these settings to affect your background.
-- "corner_r" is the radius, in pixels, of the rounded corners. If you don't want rounded corners, use 0.
corner_r=20
-- Set the colour and transparency (alpha) of your background.
bg_colour=0x000025
bg_alpha=0.90
require 'cairo'
function rgb_to_r_g_b(colour,alpha)
return ((colour / 0x10000) % 0x100) / 255., ((colour / 0x100) % 0x100) / 255., (colour % 0x100) / 255., alpha
end
function conky_draw_bg()
if conky_window==nil then return end
local w=conky_window.width
local h=conky_window.height
local cs=cairo_xlib_surface_create(conky_window.display, conky_window.drawable, conky_window.visual, w, h)
cr=cairo_create(cs)
cairo_move_to(cr,corner_r,0)
cairo_line_to(cr,w-corner_r,0)
cairo_curve_to(cr,w,0,w,0,w,corner_r)
cairo_line_to(cr,w,h-corner_r)
cairo_curve_to(cr,w,h,w,h,w-corner_r,h)
cairo_line_to(cr,corner_r,h)
cairo_curve_to(cr,0,h,0,h,0,h-corner_r)
cairo_line_to(cr,0,corner_r)
cairo_curve_to(cr,0,0,0,0,corner_r,0)
cairo_close_path(cr)
cairo_set_source_rgba(cr,rgb_to_r_g_b(bg_colour,bg_alpha))
cairo_fill(cr)
end
##############################################################
uno.name=Arduino Uno
uno.upload.protocol=arduino
uno.upload.maximum_size=32256
uno.upload.speed=115200
uno.bootloader.low_fuses=0xff
uno.bootloader.high_fuses=0xde
uno.bootloader.extended_fuses=0x05
uno.bootloader.path=optiboot
uno.bootloader.file=optiboot_atmega328.hex
uno.bootloader.unlock_bits=0x3F
uno.bootloader.lock_bits=0x0F
uno.build.mcu=atmega328p
uno.build.f_cpu=16000000L
uno.build.core=arduino
uno.build.variant=standard
##############################################################
uno20.name=ArduinoUno20
uno20.upload.protocol=arduino
uno20.upload.maximum_size=32256
uno20.upload.speed=72000
uno20.bootloader.low_fuses=0xff
uno20.bootloader.high_fuses=0xde
uno20.bootloader.extended_fuses=0x05
uno20.bootloader.path=optiboot
uno20.bootloader.file=optiboot_atmega328.hex
uno20.bootloader.unlock_bits=0x3F
uno20.bootloader.lock_bits=0x0F
uno20.build.mcu=atmega328p
uno20.build.f_cpu=20000000L
uno20.build.core=arduino
uno20.build.variant=standard
##############################################################
##############################################################
atmega328bb.name=ATmega328 on a breadboard (8 MHz internal clock)
atmega328bb.upload.protocol=stk500
atmega328bb.upload.maximum_size=30720
atmega328bb.upload.speed=57600
atmega328bb.bootloader.low_fuses=0xE2
atmega328bb.bootloader.high_fuses=0xDA
atmega328bb.bootloader.extended_fuses=0x05
atmega328bb.bootloader.path=arduino:atmega
atmega328bb.bootloader.file=ATmegaBOOT_168_atmega328_pro_8MHz.hex
atmega328bb.bootloader.unlock_bits=0x3F
atmega328bb.bootloader.lock_bits=0x0F
atmega328bb.build.mcu=atmega328p
atmega328bb.build.f_cpu=8000000L
atmega328bb.build.core=arduino:arduino
atmega32.name=minimegaboard
atmega32.upload.protocol=stk500
atmega32.upload.maximum_size=28336
atmega32.upload.speed=19200
atmega32.bootloader.low_fuses=0xff
atmega32.bootloader.high_fuses=0xdd
atmega32.bootloader.extended_fuses=0x00
atmega32.bootloader.path=atmega8
atmega32.bootloader.file=ATmegaBOOT.hex
atmega32.bootloader.unlock_bits=0x3F
atmega32.bootloader.lock_bits=0x0F
atmega32.build.mcu=atmega32
atmega32.build.f_cpu=16000000L
atmega32.build.core=arduino
atmega32.build.variant=standard
#############
###########################################################################
attiny2313at8.name=ATtiny2313 @ 8 MHz
# Default clock (slowly rising power; long delay to clock; 8 MHz internal)
# Int. RC Osc. 8 MHz; Start-up time: 14 CK + 65 ms; [CKSEL=0100 SUT=10]; default value
# Brown-out detection disabled; [BODLEVEL=111]
# Serial program downloading (SPI) enabled; [SPIEN=0]
# Preserve EEPROM memory through the Chip Erase cycle; [EESAVE=0]
attiny2313at8.bootloader.low_fuses=0xE4
#0b11100100
attiny2313at8.bootloader.high_fuses=0x9F
#0b10011111
attiny2313at8.bootloader.extended_fuses=0xFF
#SELFPRGEN: bit 0, Self Programming Enable, 1 - (unprogrammed)
attiny2313at8.bootloader.unlock_bits=0x3F
attiny2313at8.bootloader.lock_bits=0x3F
attiny2313at8.bootloader.path=empty
attiny2313at8.bootloader.file=empty2313at8.hex
attiny2313at8.build.mcu=attiny2313
attiny2313at8.build.f_cpu=8000000L
attiny2313at8.build.core=tiny
attiny2313at8.build.variant=fuckyou
attiny2313at8.upload.using=arduino:arduino
attiny2313at8.upload.maximum_size=2048
attiny2313at8.upload.protocol=arduino
attiny2313at8.upload.speed=19200
#################################################
#include <stdio.h>
#include <stdlib.h>
double uniform_deviate ()
{
int seed = rand();
return seed * ( 1.0 / ( RAND_MAX + 1.0 ) );
}
int rnd(float under)
{
int a = uniform_deviate() * under;
printf("%i z %i\n", (int)a, (int)under);
return a;
}
int serial = 1;
int column_pins[3][3] = {
{
3,4,5 }
,
{
9,10,2 }
,
{
6,7,8 }
};
int layer_pins [3]= {
12,11,13};
int skip = 10;
int mode = 0;
void setmode(int m){
mode = m;
if(mode==0)skip = 10;
if(mode==1)skip = 10;
if(serial)
{
printf("mode: %i\n", mode);
}
}
int led[3][3][3];
//
//
void set(int x,int y, int z, int val)
{
if(x<0) return;
if(y<0) return;
if(z<0) return;
if(x>2) return;
if(y>2) return;
if(z>2) return;
led[x][y][z] = val;
}
void o(int x,int y, int z)
{
set(x,y,z,1);
}
void c(int x,int y, int z)
{
set(x,y,z,0);
}
//
void clearleds(){
for(int x=0;x<3;x++)
for(int y=0;y<3;y++)
for(int z=0;z<3;z++)
led[x][y][z] = 0;
}
struct point{
int x;
int z;
};
struct flake{
int dir;
int y;
};
struct flake flakes[3][3];
void setup() {
clearleds();
}
int ctol(int x, int z)
{
int a;
if(z == 0)a=x ;
else if(z==1){
if(x == 0)a=7;
else if(x==2)a=3;else
printf("bad Z\n");
}
else if (z == 2)
a=4+(2-x);
else
printf("bad Z\n");
return a;
}
struct point ltoc(int l){
int x,z;
l = l %8;
if(l < 0) l+=7;
if(l<3){
x=l;
z=0;
}
else if(l==3){
x=2;
z=1;
}
else if((l>3)&(l<7)){
x=2-(l-4);
z=2;
}
else if(l==7){
x=0;
z=1;
}
else
printf("bad L\n");
printf("%i %i %i\n", l, x,z);
if((x<0)||(x>3))printf("ERROR");
if((z<0)||(z>3))printf("ERROR");
struct point ret ;
ret.x = x;
ret.z=z;
return ret;
}
int flakator = 0;
long long buzerator = 0;
long long buzerplac = 29999;
int dir = 0;
int rot = 0;
int counter = 0;
void anim(){
if(flakator % skip == 2)
{
switch(mode){
case 0:
buzerator += rnd(3000);
// callhome();
for(int x=0;x<3;x++)
for(int z=0;z<3;z++)
{
flakes[x][z].y += flakes[x][z].dir;
if (flakes[x][z].y > 2) flakes[x][z].y = 2;
if (flakes[x][z].y < 0) flakes[x][z].y = 0;
}
if((buzerator < buzerplac -10000) ? (rnd(1) == 0) : (rnd(buzerator-buzerplac+10000) < 100))
flakes[rnd(3)][rnd(3)].dir = rnd(3) -1;
else if(buzerator > buzerplac)
{
dir = (buzerator % 3)-1;
if (dir)
{
setmode(1);
buzerator = 0;
}
}
clearleds();
for(int x=0;x<3;x++)
for(int z=0;z<3;z++)
led[x][flakes[x][z].y][z]=1;
break;
case 1:
if (dir==0)setmode(0);
clearleds();
for(int x=0;x<3;x++)
for(int z=0;z<3;z++)
{
if((x==1)&&(z == 1))
led[x][flakes[x][z].y][z]=abs(counter++)%2;
else{
struct point p = ltoc(ctol(x,z)+rot);
led[p.x][flakes[x][z].y][p.z]=1;
}
}
if(flakator % 100 == 2)
rot += dir;
if (abs(rot) == 7)
{
rot = 0;
setmode(0);
}
break;
}
}
}
int l = 0;
int animathor = 0;
int loc[3] = {
-1,-1,-1};
void loop() {
if (animathor++ ==10) {
flakator ++;
anim();
animathor = 0;
}//printf("s");
/*
for(int x=0;x<3;x++)
for(int y=0;y<3;y++)
for(int z=0;z<3;z++)
*/
}
int main(int i, char* c)
{
setup();
//while(1)
// loop();
for(int x = 0; x< 3;x++)
for(int z = 0; z< 3;z++)
{
struct point p;
p = ltoc(ctol(x,z));
if ((p.x != x)||(p.z!=z))
printf("EEEEE\n");
}
}
[skin]
description=dark kookie
[Lines]
lefttop=┌
righttop=┐
centertop=─
centerbottom=─
leftbottom=└
rightbottom=┘
leftmiddle=├
rightmiddle=┤
centermiddle=┼
horiz=─
vert=│
thinhoriz=─
thinvert=│
[core]
_default_=green;black
selected=white,black
marked=brightred;
markselect=yellow;
gauge=;yellow
input=brightgreen;
reverse=brightgreen;black
[dialog]
_default_=brightcyan;darkgreen
dfocus=red;black
dhotnormal=brightred;
dhotfocus=yellow;black
[error]
_default_=white;red
errdhotnormal=yellow;
errdhotfocus=yellow;blue
[filehighlight]
directory=cyan;
executable=brightgreen;
symlink=red;
stalelink=yellow;
device=green;
special=blue;
core=red;
temp=gray;
archive=cyan;
doc=brown;
source=green;
media=white;
graph=yellow;
database=;
[menu]
_default_=brightgreen;black
menuhot=yellow;
menusel=brightcyan;blue
menuhotsel=yellow;
menuinactive=lightgray;
[help]
_default_=brightred;black
helpitalic=brightcyan;
helpbold=brightgreen;
helplink=white;
helpslink=yellow;black
[editor]
_default_=lightgray;black
editbold=yellow;black
editmarked=brightgreen;red
editwhitespace=brightgreen;black
editlinestate=brightgreen
bookmark=white;red
bookmarkfound=black;green
[viewer]
viewunderline=brightgreen;black
[buttonbar]
hotkey=blue;black
button=white;black
TERM=linux-m finch
#!/usr/bin/python
#-*- coding: utf-8 -*-
import os, sys, signal, codecs, re, optparse
import pygame
from pygame import gfxdraw, font
pygame.init()
def init_screen():
screen_surface = pygame.display.set_mode((800,300))
screen_surface.fill((0,0,0))
pygame.display.flip()
init_screen()
lives = 1
bits = [0 for bits in range(0, 8)]
""""""
colemak={}
colemak['top'] = "qwfpgjluy;[]"
colemak['mid'] = "arstdhneio'\\"
colemak['low'] = "zxcvbkm,./"
colemak['low_shit'] = ['COMMA', 'PERIOD', 'SLASH']
key=colemak
""""""
""""""
radius = 40
""""""
font = font.SysFont('monospace', 8)
def kkk(key):
return pygame.__dict__['K_'+key]
while lives:
for event in pygame.event.get():
if event.type == pygame.QUIT:
lives = 0
elif event.type == pygame.KEYDOWN and event.key == pygame.K_ESCAPE:
lives-=1
row=key['low']
for col in range(0, min(len(bits),len(row))):
char = row[col]
try:
pygakey = kkk(char)
print pygakey
except Exception:
try:
pygakey = kkk(key['low_shit'][0])
except Exception:
pygakey = None
print 'add '+char
if pygakey and pygame.key.get_pressed()[pygakey]:
bits[col] = not bits[col]
x = radius+col*radius
pygame.gfxdraw.circle(screen_surface, x,radius,radius, (0,100 if bits[col] else 0,0))
txt = font.render(pygame.key.name(pygakey),False,(120,120,120))
screen_surface.blit(txt,(x,radius))
mods = pygame.key.get_mods()
if mods & pygame.KMOD_LSHIFT:
print "left shift pressed"
pygame.display.flip()
<html><body><h1>It works!</h1>
<p>This is the default web page for this server.</p>
<p>The web server software is running but no content has been added, yet.</p>
<?php
$handle=opendir('/etc/apache2/conf.d');
$it = array();
while (false !== ($file = readdir($handle)))
{
if(preg_match("/Alias \/([a-zA-Z0-9]*)?/", file_get_contents('/etc/apache2/conf.d/'.$file), $it))
{
echo "<a href=\"$it[1]\">$it[1]</a>";
echo "<br>\n";
}
}
closedir($handle);
?>
</body></html>
#!/usr/bin/perl -w
#
# mpdtube.pl
# version 0.2
# author Johan Ask
#
# Script to download youtube clips, convert to mp3 and add to an mpd playlist.
#
# This script can be run both on the commandline and as a CGI script.
# commandline usage: mpdtube.pl youtube-code title
# http usage: mpdtube.pl?code=xxxxx&title=Name%20of%20song
# youtube code means the value XXX in http://www.youtube.com/watch?v=XXX
#
# Dependencies:
# - perl
# - cpan perl modules: MP3::Tag, Audio::MPD
# - youtube-dl, a python script
# - ffmpeg
#
# TODO:
# - add commandline options and something similar for cgi
# - find out why the tagging won't work
# - start converting to mp3 directly from the stream
# - be able to force redownload
# - any other ideas?
#
use strict;
use Audio::MPD;
use MP3::Tag;
use CGI;
# global variables
my $DIR = "/media/hudba/mpdtube";
my $MPD_HOST = "localhost";
my $MPD_PORT = 6600;
my $VERSION = 0.2;
my $VERBOSE = 1;
my $CGI;
# input variables
my $yt_code;
my $yt_title;
my $query = new CGI;
# check input
if($#ARGV == 1)
{
$yt_code = $ARGV[0];
$yt_title = $ARGV[1];
$CGI = 0;
}
elsif($query->param("code") && $query->param("title"))
{
$yt_code = $query->param("code");
$yt_title = $query->param("title");
$CGI = 1;
}
else
{
output("Wrong input\n");
exit 1;
}
if($CGI)
{
print $query->header();
}
if($yt_code =~ m/[^a-z0-9_]/i)
{
output("Youtube code contains invalid characters\n");
exit 1;
}
# download
my $tmp_file_name = youtube_dl($yt_code, $DIR);
# convert
if(-e "$DIR/$tmp_file_name.flv")
{
flv2mp3("$DIR/$tmp_file_name.flv", "$DIR/$tmp_file_name.mp3");
unlink "$DIR/$tmp_file_name.flv";
add_id3("$DIR/$tmp_file_name.mp3",$yt_title);
}
# and add
mpd_queue("$tmp_file_name.mp3", $DIR);
exit 0;
# only subroutines below
sub youtube_dl
{
my $code = shift;
my $dir = shift;
my $file = "youtube-$code";
my $url = "http://www.youtube.com/watch?v=$code";
if(-e "$dir/$file.mp3")
{
output("MP3-file already exists, skip download\n");
return $file;
}
output("Downloading video file\n");
#exec("youtube-dl -q -c --output=$dir/$file.flv $url") unless fork;
system("youtube-dl -q -c --output=$dir/$file.flv $url");
return $file;
}
sub flv2mp3
{
my $in = shift;
my $out = shift;
output("Converting flv to mp3\n");
system("ffmpeg -i $in -acodec libmp3lame -ac 2 -ab 128k -vn -y $out");
}
sub mpd_queue
{
my $song = shift;
my $dir = shift;
my $mpd = Audio::MPD->new("host" => $MPD_HOST, "port" => $MPD_PORT);
my $stat=`mpc update mpdtube`;
output($stat);
while($stat=~/^Updating DB/m)
{
output(".");
sleep 3;
$stat=`mpc`;
}
output("\n");
output("Adding song to queue: $dir/$song\n");
$mpd->playlist->add("mpdtube/$song");
$mpd->play;
}
sub add_id3
{
my $file = shift;
my $title = shift;
output("Creating id3-tag\n");
my $mp3 = MP3::Tag->new($file);
my $tag = $mp3->new_tag("ID3v1");
$tag->title($title);
$tag->artist("Youtube");
$tag->album("Youtube");
$tag->write_tag();
}
sub output
{
my $str = shift;
if($CGI)
{
$str =~ s/\n/<br\/>/g;
# open(outoputo, '>>/var/lib/mpd/mpdtube/status');
print $str;
}
else
{
if($VERBOSE)
{
print $str;
}
}
}
context default
keyword : brightred
keyword . white/Orange
keyword > yellow
keyword < yellow
keyword \+ yellow
keyword - yellow
keyword \* yellow
keyword / yellow
keyword % yellow
keyword = yellow
keyword != yellow
keyword == yellow
keyword { brightcyan
keyword } brightcyan
keyword ( brightcyan
keyword ) brightcyan
keyword [ brightcyan
keyword ] brightcyan
keyword , brightcyan
keyword ; brightmagenta
keyword whole self green
keyword whole and yellow
keyword whole as yellow
keyword whole assert yellow
keyword whole break yellow
keyword whole class yellow
keyword whole continue yellow
keyword whole def yellow
keyword whole del yellow
keyword whole elif yellow
keyword whole else yellow
keyword whole except yellow
keyword whole exec yellow
keyword whole finally yellow
keyword whole for yellow
keyword whole from yellow
keyword whole global yellow
keyword whole if yellow
keyword whole import yellow
keyword whole in yellow
keyword whole is yellow
keyword whole lambda yellow
keyword whole not yellow
keyword whole or yellow
keyword whole pass yellow
keyword whole print yellow
keyword whole raise yellow
keyword whole return yellow
keyword whole try yellow
keyword whole while yellow
keyword whole with yellow
keyword whole yield yellow
keyword whole abs brightcyan
keyword whole all brightcyan
keyword whole any brightcyan
keyword whole basestring brightcyan
keyword whole bin brightcyan
keyword whole bool brightcyan
keyword whole callable brightcyan
keyword whole chr brightcyan
keyword whole classmethod brightcyan
keyword whole cmp brightcyan
keyword whole coerce brightcyan
keyword whole compile brightcyan
keyword whole complex brightcyan
keyword whole delattr brightcyan
keyword whole dict brightcyan
keyword whole dir brightcyan
keyword whole divmod brightcyan
keyword whole enumerate brightcyan
keyword whole eval brightcyan
keyword whole execfile brightcyan
keyword whole file brightcyan
keyword whole filter brightcyan
keyword whole float brightcyan
keyword whole frozenset brightcyan
keyword whole getattr brightcyan
keyword whole globals brightcyan
keyword whole hasattr brightcyan
keyword whole hash brightcyan
keyword whole help brightcyan
keyword whole hex brightcyan
keyword whole id brightcyan
keyword whole input brightcyan
keyword whole int brightcyan
keyword whole isinstance brightcyan
keyword whole issubclass brightcyan
keyword whole iter brightcyan
keyword whole len brightcyan
keyword whole list brightcyan
keyword whole locals brightcyan
keyword whole long brightcyan
keyword whole map brightcyan
keyword whole max brightcyan
keyword whole min brightcyan
keyword whole next brightcyan
keyword whole object brightcyan
keyword whole oct brightcyan
keyword whole open brightcyan
keyword whole ord brightcyan
keyword whole pow brightcyan
keyword whole print brightcyan
keyword whole property brightcyan
keyword whole range brightcyan
keyword whole raw_input brightcyan
keyword whole reduce brightcyan
keyword whole reload brightcyan
keyword whole repr brightcyan
keyword whole reversed brightcyan
keyword whole round brightcyan
keyword whole setattr brightcyan
keyword whole slice brightcyan
keyword whole sorted brightcyan
keyword whole staticmethod brightcyan
keyword whole str brightcyan
keyword whole sum brightcyan
keyword whole super brightcyan
keyword whole tuple brightcyan
keyword whole type brightcyan
keyword whole unichr brightcyan
keyword whole unicode brightcyan
keyword whole vars brightcyan
keyword whole xrange brightcyan
keyword whole zip brightcyan
keyword whole atof magenta
keyword whole atoi magenta
keyword whole atol magenta
keyword whole expandtabs magenta
keyword whole find magenta
keyword whole rfind magenta
keyword whole index magenta
keyword whole rindex magenta
keyword whole count magenta
keyword whole split magenta
keyword whole splitfields magenta
keyword whole join magenta
keyword whole joinfields magenta
keyword whole strip magenta
keyword whole lstrip magenta
keyword whole rstrip magenta
keyword whole swapcase magenta
keyword whole upper magenta
keyword whole lower magenta
keyword whole ljust magenta
keyword whole rjust magenta
keyword whole center magenta
keyword whole zfill magenta
keyword whole __init__ lightgray
keyword whole __del__ lightgray
keyword whole __repr__ lightgray
keyword whole __str__ lightgray
keyword whole __cmp__ lightgray
keyword whole __hash__ lightgray
keyword whole __call__ lightgray
keyword whole __getattr__ lightgray
keyword whole __setattr__ lightgray
keyword whole __delattr__ lightgray
keyword whole __len__ lightgray
keyword whole __getitem__ lightgray
keyword whole __setitem__ lightgray
keyword whole __delitem__ lightgray
keyword whole __getslice__ lightgray
keyword whole __setslice__ lightgray
keyword whole __delslice__ lightgray
keyword whole __add__ lightgray
keyword whole __sub__ lightgray
keyword whole __mul__ lightgray
keyword whole __div__ lightgray
keyword whole __mod__ lightgray
keyword whole __divmod__ lightgray
keyword whole __pow__ lightgray
keyword whole __lshift__ lightgray
keyword whole __rshift__ lightgray
keyword whole __and__ lightgray
keyword whole __xor__ lightgray
keyword whole __or__ lightgray
keyword whole __neg__ lightgray
keyword whole __pos__ lightgray
keyword whole __abs__ lightgray
keyword whole __invert__ lightgray
keyword whole __nonzero__ lightgray
keyword whole __coerce__ lightgray
keyword whole __int__ lightgray
keyword whole __long__ lightgray
keyword whole __float__ lightgray
keyword whole __oct__ lightgray
keyword whole __hex__ lightgray
keyword whole __radd__ lightgray
keyword whole __rsub__ lightgray
keyword whole __rmul__ lightgray
keyword whole __rdiv__ lightgray
keyword whole __rmod__ lightgray
keyword whole __rdivmod__ lightgray
keyword whole __rpow__ lightgray
keyword whole __rlshift__ lightgray
keyword whole __rrshift__ lightgray
keyword whole __rand__ lightgray
keyword whole __rxor__ lightgray
keyword whole __ror__ lightgray
keyword whole __+__ brightblue
context """ """ green
keyword \\" brightgreen
keyword \\\n brightgreen
keyword %% brightgreen
keyword %\[#0\s-\+,\]\[0123456789\]\[.\]\[0123456789\]\[L\]\{eEfgGoxX\} brightgreen
keyword %\[0\s-\+,\]\[0123456789\]\[.\]\[0123456789\]\[hl\]\{diu\} brightgreen
keyword %\[hl\]n brightgreen
keyword %\[.\]\[0123456789\]s brightgreen
keyword %[*] brightgreen
keyword %c brightgreen
keyword \\\{0123\}\{01234567\}\{01234567\} brightgreen
keyword \\\\{01234567\}\{01234567\} brightgreen
keyword \\\\{01234567\} brightgreen
keyword \\\\ brightgreen
keyword \\' brightgreen
keyword \\\{abtnvfr\} brightgreen
context ''' ''' green
keyword \\" brightgreen
keyword \\\n brightgreen
keyword %% brightgreen
keyword %\[#0\s-\+,\]\[0123456789\]\[.\]\[0123456789\]\[L\]\{eEfgGoxX\} brightgreen
keyword %\[0\s-\+,\]\[0123456789\]\[.\]\[0123456789\]\[hl\]\{diu\} brightgreen
keyword %\[hl\]n brightgreen
keyword %\[.\]\[0123456789\]s brightgreen
keyword %[*] brightgreen
keyword %c brightgreen
keyword \\\{0123\}\{01234567\}\{01234567\} brightgreen
keyword \\\\{01234567\}\{01234567\} brightgreen
keyword \\\\{01234567\} brightgreen
keyword \\\\ brightgreen
keyword \\' brightgreen
keyword \\\{abtnvfr\} brightgreen
context # \n brown
keyword coding\{=:\}\[\s\]\[-0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ_abcdefghijklmnopqrstuvwxyz\] brightmagenta
keyword vim:fileencoding=\[-0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ_abcdefghijklmnopqrstuvwxyz\] brightmagenta
keyword -\*-\[\s\]coding:\[\s\]\[-0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ_abcdefghijklmnopqrstuvwxyz\]\[\s\]-\*- brightmagenta
spellcheck
context " " green
keyword \\" brightgreen
keyword %% brightgreen
keyword %\[#0\s-\+,\]\[0123456789\]\[.\]\[0123456789\]\[L\]\{eEfgGoxX\} brightgreen
keyword %\[0\s-\+,\]\[0123456789\]\[.\]\[0123456789\]\[hl\]\{diuxX\} brightgreen
keyword %\[hl\]n brightgreen
keyword %\[.\]\[0123456789\]s brightgreen
keyword %[*] brightgreen
keyword %c brightgreen
keyword \\\{0123\}\{01234567\}\{01234567\} brightgreen
keyword \\\\ brightgreen
keyword \\' brightgreen
keyword \\\{abtnvfr\} brightgreen
context ' ' green
keyword \\" brightgreen
keyword \\\n brightgreen
keyword %% brightgreen
keyword %\[#0\s-\+,\]\[0123456789\]\[.\]\[0123456789\]\[L\]\{eEfgGoxX\} brightgreen
keyword %\[0\s-\+,\]\[0123456789\]\[.\]\[0123456789\]\[hl\]\{diuxX\} brightgreen
keyword %\[hl\]n brightgreen
keyword %\[.\]\[0123456789\]s brightgreen
keyword %[*] brightgreen
keyword %c brightgreen
keyword \\\{0123\}\{01234567\}\{01234567\} brightgreen
keyword \\\\ brightgreen
keyword \\' brightgreen
keyword \\\{abtnvfr\} brightgreen
#!/home/kook/local/node/bin/node
var util = require('util');
var spawn = require('child_process').spawn;
var ssh = spawn('ssh', ['-tt', '10.100']);
ssh.stdout.on('data', function (data) {
console.log('X'+data);
});
ssh.stderr.on('data', function (data) {
console.log(data);
});
ssh.on('exit', function (code) {
console.log('child process exited with code ' + code);
})
process.stdin.resume();
process.stdin.on('data', function (chunk) {
ssh.stdin.write(chunk);
});
"tttesttt" by "kook"
Home is a room. A hamburger is here.
Include (- Constant DEBUG; -) after "Definitions.i6t".
oh is indexed text variable.
Understand "command [text]" as commanding. Commanding is an action applying to one topic.
Carry out commanding:
say "[topic understood]";
say "[perform try mary trying taking the hamburger]";
To perform (command - phrase): (- if (0==0) {ph} -).
Mary is a woman in home. Mary carries a flower.
Instead of asking Mary about a topic listed in the table of Mary talk, say response entry.
Table of Mary talk
topic response
"food" "'I like food.'[paragraph break][perform try mary trying taking the hamburger]"
"flowers" "[if mary carries the flower]'Here, have a flower.'[paragraph break]
[perform try mary trying dropping the flower]
[otherwise]'I'm sorry, I have no more flowers.'[paragraph break][end if]"
"exits" "'I have to go now.' And with that, she vanishes.[perform remove mary from play][paragraph break]"
Test me with "ask mary about food / ask mary about flowers / ask mary about flowers / ask mary about exits".
To say perform (ph - phrase): (- if (0==0) {ph} -).
#!/usr/bin/env coffee
path = require 'path'
fs = require 'fs'
os = require 'os'
spawn = require('child_process').spawn
paths={}
paths.home = process.env['HOME'] + "/.timetracker"
paths.time = paths.home + "/time.json"
console.log paths.time + " exists: " + path.existsSync paths.time
git = (arg) ->
if path.existsSync paths.home
process.chdir paths.home
git = spawn "git"
git.stdout.on 'data', (data)->
console.log ":"+data
load = ()->
git 'pull'
if path.existsSync paths.time
JSON.parse fs.readFileSync paths.time
save =()->
if not path.existsSync paths.home
fs.mkdirSync paths.home, 700
fs.writeFileSync paths.time, JSON.stringify time
console.log "written"
git 'add time.json'
git 'commit'
git 'push'
time = load() || {}
addparam = (o,param)->
unless param of o
o[param] = 0
o
addclock = (o)->
o = addparam o, 'hours'
o = addparam o, 'minutes'
o = addparam o, 'seconds'
time = addclock time
console.log time
session = addclock {}
overflow = (time)->
if time.seconds > 59
time.seconds -= 60
time.minutes++
if time.minutes > 59
time.minutes -= 60
time.hours++
time
saverid = incerid = null
togglerunning =()->
if incerid
clearInterval incerid
clearInterval saverid
incerid = saverid = null
console.log "stopped"
else
incerid = setInterval ()->
time.seconds++
session.seconds++
time = overflow time
session = overflow session
human = session.hours + ":" + session.minutes + ":" + session.seconds
console.log human + "\33]0;" + human + "\7"
, 1000
saverid = setInterval ()->
save()
, 1000*60*10
console.log "running"
togglerunning()
process.stdin.resume();
process.stdin.on 'data', (data) ->
togglerunning()
process.on 'SIGINT' ,()->
console.log "saving"
save()
process.exit()
import sys
for i in sorted(sys.stdin.readlines()):
sys.stdout.write(i)
import serial, time
a=serial.Serial("/dev/ttyS0",timeout=0)
def pause():
time.sleep(0.1)
pass
def bit(b):
a.setRTS(1)
pause()
a.setDTR(not b)
pause()
a.setRTS(0)
pause()
a.setBreak(0)
pause()
a.setBreak(1)
pause()
while 1:
t = int(time.time())
for i in range(0,8):
bit(0)
pause()
#!/bin/bash
tail -fq ~/.xchat2/xchatlogs/* |grep -v has_joined |grep -v has_quit
xkbcomp xkb.dump :0
xset r rate 300 33
xrandr --output LVDS1 --auto
xrandr --output VGA1 --off
xrandr --output VGA1 --auto
xrandr --output VGA1 --left-of LVDS1
xrandr --output LVDS1 --auto
grammar zzz;
ID : ('a'..'z'|'A'..'Z'|'_') ('a'..'z'|'A'..'Z'|'0'..'9'|'_')*
;
INT : '0'..'9'+
;
FLOAT
: ('0'..'9')+ '.' ('0'..'9')* EXPONENT?
| '.' ('0'..'9')+ EXPONENT?
| ('0'..'9')+ EXPONENT
;
COMMENT
: '//' ~('\n'|'\r')* '\r'? '\n' {$channel=HIDDEN;}
| '/*' ( options {greedy=false;} : . )* '*/' {$channel=HIDDEN;}
;
WS : ( ' '
| '\t'
| '\r'
| '\n'
) {$channel=HIDDEN;}
;
STRING
: '"' ( ESC_SEQ | ~('\\'|'"') )* '"'
;
fragment
EXPONENT : ('e'|'E') ('+'|'-')? ('0'..'9')+ ;
fragment
HEX_DIGIT : ('0'..'9'|'a'..'f'|'A'..'F') ;
fragment
ESC_SEQ
: '\\' ('b'|'t'|'n'|'f'|'r'|'\"'|'\''|'\\')
| UNICODE_ESC
| OCTAL_ESC
;
fragment
OCTAL_ESC
: '\\' ('0'..'3') ('0'..'7') ('0'..'7')
| '\\' ('0'..'7') ('0'..'7')
| '\\' ('0'..'7')
;
fragment
UNICODE_ESC
: '\\' 'u' HEX_DIGIT HEX_DIGIT HEX_DIGIT HEX_DIGIT
;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment