View xslt.cs
using System;
using System.IO;
using System.Xml;
using System.Xml.Xsl;
namespace XSLTEvaluator
{
public class MainClass
{
public static void Main(string[] Args)
View leaderkey.py
#!/usr/bin/python3
from enum import Enum
import os
import subprocess
import string
import sys
import tkinter
# Maps key symbols in the configuration language into keysyms known to Tk
KEY_TO_KEYSYM = {
View driveby.js
function clickAll(elems) {
for (var i = 0; i < elems.length; i++) {
elems[i].click();
}
}
function driveByUpvote() {
clickAll($('[aria-label="upvote"]'));
}
View shader.glsl
vec4 colorAt(in vec2 coord, in int channel) {
if (channel == 0) return texture2D(iChannel0, coord.xy / iChannelResolution[0].xy);
if (channel == 1) return texture2D(iChannel1, coord.xy / iChannelResolution[1].xy);
if (channel == 2) return texture2D(iChannel2, coord.xy / iChannelResolution[2].xy);
if (channel == 3) return texture2D(iChannel3, coord.xy / iChannelResolution[3].xy);
}
float monochrome(in vec4 color) {
return (color.r + color.g + color.b) / 3.0;
}
View evil.java
class Bean {}
class Main {
// Visibility Access Type id
public static int x;
public int[] x;
private static boolean x;
private Bean x;
private Bean[] xIs_A_Good_Variable_Name18283_28AXY;
View case-gen.py
from collections import namedtuple
import random
import string
import sys
Node = namedtuple('Node', ['grammar'])
Output = namedtuple('Output', ['text'])
# All of these are easier to compute than to specify literally in the grammar
ALPHABET_NODES = [[Output(letter)] for letter in string.letters]
View prepared.vbs
' Creates a prepared statement and populates its parameters
'
' Usage:
'
' Dim stmt as QueryDef
' Set stmt = PrepareStatement(CurrentDb, "SELECT * FROM T WHERE A = [aval] AND B = [bval]", _
' "aval", 42, _
' "bval", "Carrot Cake")
'
Public Function PrepareStatement(db As Database, sql As String, ParamArray params()) As QueryDef
View regex.py
"""
An NDFA-based regular expression evaluator, built in the style of the Thompson NFA.
"""
from collections import deque, namedtuple
# These are both singletons indicating:
#
# - A split in the NDFA. These never read any characters, so the matcher has to
# evaluate every side of the split in order to continue.
# - The end of the NDFA.
View git-deploy.sh
#!/bin/bash
help() {
echo "`basename $0` [-h] -d <DEPLOY-DIR> -r <REPO-DIR>
Does the necessary work to use a Git repository for deployment.
This creates two directories - DEPLOY-DIR and REPO-DIR. REPO-DIR is
a bare repository that you can push to and pull from like any repository,
while DEPLOY-DIR contains the contents of the 'master' branch. Git hooks
are used to keep DEPLOY-DIR up to date with REPO-DIR."
View utils.js
/*
* Returns a list of all the text nodes under the given node.
*
* The order should be depth-first, first-to-last across siblings.
*/
function findTextNodes(node) {
var HTML_TEXT_NODE = 3;
if (node.nodeType == HTML_TEXT_NODE) {
return [node];
}