In JavaScript:
whatever.domClassName = 'foo';
In HTML:
| <?php | |
| // inserts 1,000,000 docs in 14 seconds on a MacBook Pro running Ubuntu 9.04 | |
| class Timer | |
| { | |
| var $start; | |
| var $pause_time; | |
| /* start the timer */ |
| <?php | |
| function getReplicationInfo($m) { | |
| $db = $m->local; | |
| $result = array(); | |
| $ol = $db->system->namespaces->findOne(array("name" => 'local.oplog.$main')); | |
| if ($ol && array_key_exists('options', $ol)) { | |
| $result['logSizeMB'] = $ol['options']['size'] / 1000 / 1000; |
| #include <stdio.h> | |
| #include "other.h" | |
| #include "tester.h" | |
| namespace other { | |
| void other_type::some_method() { | |
| printf("here\n"); | |
| } | |
| } |
| #!/usr/bin/mongo informadiko | |
| // ┏━┓┏━╸┏━╸┏━┓╻ ╻┏┓╻╺┳╸┏━┓ | |
| // ┣━┫┃ ┃ ┃ ┃┃ ┃┃┗┫ ┃ ┗━┓ | |
| // ╹ ╹┗━╸┗━╸┗━┛┗━┛╹ ╹ ╹ ┗━┛ | |
| db.dropDatabase() // BE CAREFUL | |
| //db.createCollection("system.profile", {capped:true, size:1024000000}) // 1024 Megs | |
| db.setProfilingLevel(2); |
| // 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 |
| #!/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 |
| 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; |
| 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) { |
| 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()); |