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
/* | |
findexec.js | |
demo of jjs, takes a single argument - a folder in which to search | |
for executable files, which will be printed to stdout. | |
example: | |
$ jjs ./filerev.js -- /usr/bin | |
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
/* | |
stdinplot.js | |
demo of jss usage - reads numbers from stdin and displays a dynamically | |
scaling line graph. ignores non-numerical values. | |
example: | |
$ jjs -fx stdinplot.js < sin_values.txt | |
*/ |
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
// import statements | |
var ByteBuffer = java.nio.ByteBuffer; | |
var Application = javafx.application.Application; | |
var Group = javafx.scene.Group; | |
var Scene = javafx.scene.Scene; | |
var Canvas = javafx.scene.canvas.Canvas; | |
var GraphicsContext = javafx.scene.canvas.GraphicsContext; | |
var DropShadow = javafx.scene.effect.DropShadow; | |
var PixelFormat = javafx.scene.image.PixelFormat; | |
var PixelWriter = javafx.scene.image.PixelWriter; |
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
/* | |
filerev.js | |
demo of jjs, takes stdin or list of files and takes entirety of buffer | |
or list of files, reads them into memory and prints them in reverse order. | |
awful code, purely to demonstrate the interaction between js and Java in the | |
Nashorn platform. | |
example 1: |
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 | |
# Demonstration of two different optimisations which can be applied to the bytecode | |
# python generates for two differnent string concatenation techniques. | |
import time | |
from byteplay import * | |
loop_count = 1000000 |
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 | |
from cStringIO import StringIO | |
import time, commands, os | |
from sys import argv | |
def method1(): | |
out_str = '' | |
for num in xrange(loop_count): | |
out_str += `num` |
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 | |
# this is a completely horrible hack to get the LED device - I have no idea how to get the | |
# actual device name from /sys/class/leds | |
ledPattern="[0-9A-F]{4}:[0-9A-F]{4}:[0-9A-F]{4}\.[0-9A-F]{4}:" | |
deviceName=`ls -1 /sys/class/leds | grep -E $ledPattern | sed -r "s/:\w+$//" | head -n 1` | |
function setLED { | |
echo $1 > /sys/class/leds/$deviceName:$2/brightness | |
} |
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
import pygame | |
from pygame.locals import * | |
from OpenGL.GL import * | |
from OpenGL.GLU import * | |
surfaces = ( | |
(1, 2, 3, 4), | |
(3, 2, 7, 6), | |
(6, 7, 5, 4), | |
(4, 5, 1, 0), |
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
diff -bur svgalib-1.4.3/gl/Makefile svgalib-1.4.3-smcl/gl/Makefile | |
--- svgalib-1.4.3/gl/Makefile 1999-07-18 10:14:45.000000000 +0200 | |
+++ svgalib-1.4.3-smcl/gl/Makefile 2016-06-24 00:11:39.368615455 +0200 | |
@@ -29,7 +29,7 @@ | |
.PHONY: all clean dep | |
libvgagl.so.$(VERSION): $(MODULES) | |
- $(CC) -s -shared -Wl,-soname,libvgagl.so.$(MAJOR_VER) -o libvgagl.so.$(VERSION) \ | |
+ $(CC) -m32 -s -shared -Wl,-soname,libvgagl.so.$(MAJOR_VER) -o libvgagl.so.$(VERSION) \ | |
$(MODULES) |
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 | |
# create four fifos connected in a ring, and fire the word "turd" into it | |
# because reasons | |
mkfifo pipe1 | |
mkfifo pipe2 | |
mkfifo pipe3 | |
mkfifo pipe4 | |
echo turd > pipe1 & |