In JavaScript:
whatever.domClassName = 'foo';
In HTML:
# Copyright 2015 The Bazel Authors. All rights reserved. | |
# | |
# Licensed under the Apache License, Version 2.0 (the "License"); | |
# you may not use this file except in compliance with the License. | |
# You may obtain a copy of the License at | |
# | |
# http://www.apache.org/licenses/LICENSE-2.0 | |
# | |
# Unless required by applicable law or agreed to in writing, software | |
# distributed under the License is distributed on an "AS IS" BASIS, |
import time | |
import BaseHTTPServer | |
HOST_NAME = 'localhost' | |
PORT_NUMBER = 9000 # Choose a number > 1024. | |
class MyHandler(BaseHTTPServer.BaseHTTPRequestHandler): | |
def do_GET(s): | |
"""Respond to a GET request.""" | |
s.send_response(200) |
import java.util.ArrayList; | |
public class Zoo { | |
public static void main(String[] args) { | |
ArrayList<Animal> animals = new ArrayList<Animal>(); | |
// Generate 100 random animals. | |
for (int i = 0; i < 100; i++) { | |
double randomNum = Math.random(); |
import java.util.ArrayList; | |
public class Runner { | |
public static void main(String[] args) { | |
Person msM = new Teacher("Ms.", "M"); | |
ArrayList<Person> people = new ArrayList<Person>(); | |
people.add(msM); | |
msM.getName(); | |
((Teacher) msM).assignHomework(); |
public class SubwayLine { | |
public static void main(String[] args) { | |
Train local = new Train("C", 1, 16); | |
Train express = new Train("A", 3, 0); | |
for (int i = 0; i < 10; ++i) { | |
System.out.println("local: " + local.nextStop()); | |
System.out.println("express: " + express.nextStop()); |
public class Restaurant { | |
public static void main(String args[]) throws InterruptedException { | |
Kitchen kitchen = new Kitchen(); | |
while (true) { | |
Order meal = kitchen.checkForFinished(); | |
System.out.println("Finished: " + meal); | |
// Maybe send a new order to the kitchen. | |
double rand = Math.random(); | |
if (rand < .1) { |
import java.io.File; | |
import java.io.FileNotFoundException; | |
import java.io.FileOutputStream; | |
import java.io.IOException; | |
import java.net.URL; | |
import java.nio.channels.Channels; | |
import java.nio.channels.ReadableByteChannel; | |
import java.util.ArrayList; | |
import java.util.NoSuchElementException; |
#!/bin/bash | |
# Shows branches with descriptions | |
branches=$(git for-each-ref --format='%(refname)' refs/heads/ | sed 's|refs/heads/||') | |
for branch in $branches; do | |
last_used=$(git show --pretty=format:"%Cgreen%cr%Creset" $branch | head -1) | |
desc=$(git config branch.$branch.description) | |
if [ $branch == $(git rev-parse --abbrev-ref HEAD) ]; then | |
branch="*\t$last_used\t\033[0;32m$branch\033[0m" | |
else |
// Copyright (C) 2013 Kristina Chodorow | |
// | |
// Permission is hereby granted, free of charge, to any person obtaining a copy | |
// of this software and associated documentation files (the "Software"), to deal | |
// in the Software without restriction, including without limitation the rights | |
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | |
// copies of the Software, and to permit persons to whom the Software is | |
// furnished to do so, subject to the following conditions: | |
// | |
// The above copyright notice and this permission notice shall be included in |