Skip to content

Instantly share code, notes, and snippets.

View dblevins's full-sized avatar

David Blevins dblevins

View GitHub Profile
-- 1. Pick HELLOWORLD as the unique identifier.
-- 2. Pick /hiw and /hellow as slash commands (/hi and /hello are actual emotes)
SLASH_HELLOWORLD1, SLASH_HELLOWORLD2 = '/hiw', '/hellow'; -- 3.
function SlashCmdList.HELLOWORLD(msg, editbox) -- 4.
print("Hello, World!");
end
SLASH_HELLOWORLD1, SLASH_HELLOWORLD2 = '/hiw', '/hellow';
local function handler(msg, editbox)
if msg == 'bye' then
print('Goodbye, World!');
else
print("Hello, World!");
end
end
SlashCmdList["HELLOWORLD"] = handler; -- Also a valid assignment strategy
/**
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You 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
*
/**
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You 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
*
/**
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You 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
*
/**
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You 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
*
#!/bin/bash
function somecommand {
echo "$# args:"
for n in "$@"; do
echo "- $n"
done
echo
}
26c26
< <artifactId>guess</artifactId>
---
> <artifactId>decorator</artifactId>
32c32
< <finalName>guess</finalName>
---
> <finalName>decorator</finalName>
$ wget --no-check-certificate http://repository.apache.org/content/repositories/openejb-012/org/apache/openejb/openejb-standalone/3.1.2/openejb-standalone-3.1.2.zip
--16:53:23-- http://repository.apache.org/content/repositories/openejb-012/org/apache/openejb/openejb-standalone/3.1.2/openejb-standalone-3.1.2.zip
=> `openejb-standalone-3.1.2.zip.1'
Resolving repository.apache.org... 140.211.11.100
Connecting to repository.apache.org|140.211.11.100|:80... connected.
HTTP request sent, awaiting response... 302 Found
Location: https://repository.apache.org/content/repositories/openejb-012/org/apache/openejb/openejb-standalone/3.1.2/openejb-standalone-3.1.2.zip [following]
--16:53:23-- https://repository.apache.org/content/repositories/openejb-012/org/apache/openejb/openejb-standalone/3.1.2/openejb-standalone-3.1.2.zip
=> `openejb-standalone-3.1.2.zip.1'
Connecting to repository.apache.org|140.211.11.100|:443... connected.
import junit.framework.TestCase;
public class MemoryTest extends TestCase {
public void test() {
Runtime runtime = Runtime.getRuntime();
System.out.println("maxMemory = " + runtime.maxMemory());
System.out.println("freeMemory = " + runtime.freeMemory());