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
skilldb % python skilldb.py | |
No embedding_function provided, using default embedding function: DefaultEmbeddingFunction https://huggingface.co/sentence-transformers/all-MiniLM-L6-v2 | |
hhh: agent_executor.run... | |
> Entering new AgentExecutor chain... | |
hhh: SkilledAgent... | |
{ | |
"tasks": [ | |
{ |
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
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<meta charset="UTF-8"> | |
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | |
<title>LLM Laughs: Hilarious Jokes About Large Language Models</title> | |
<style> | |
body { | |
font-family: Arial, sans-serif; | |
} |
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
// Example of an iterator that works over a sequence of multiple collections. | |
def a = [1, 2] | |
def b = [3, 4] | |
def c = new CollectionSequence(a, b) | |
// The elements of the collections look like one concatenated list. | |
println (c as List) | |
// Mutating the elements of one of the collections changes what we get. |
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
class SomeBean { | |
private String _memo | |
String foo() { _memo } | |
void foo(String v) { _memo = v } | |
public static void main(String[] args) { | |
SomeBean bean = new SomeBean(); | |
bean.foo = 'bar' | |
println bean.foo |
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 | |
# Source: http://toomuchdata.com/2012/06/25/how-to-install-python-2-7-3-on-centos-6-2/ | |
# Install stuff # | |
################# | |
# Install development tools and some misc. necessary packages | |
yum -y groupinstall "Development tools" | |
yum -y install tar python-setuptools # Not included in Minimal group and Base is huge. |
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
package org.ifcx.snippets; | |
/** | |
* Created by jim on 9/13/14. | |
*/ | |
public class Foo { | |
protected int x; | |
int getX() { return x + 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
def dat = ['NCC_TEST': [1234, 1345, 1232, 1133, 1100], 'NCC_TEST2': [9999,8765, 4321]] | |
println """update tablename set IsEnriched = 999 where ${ | |
dat.collect { name, serials -> | |
"(ServerName = '$name' and ServerSerial in (${ serials.join(', ') }))" | |
}.join(" or ") | |
}""" |
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
// Fixed synthetic class snippet originally from <anonimista@outlook.com>. | |
import groovyjarjarasm.asm.Opcodes | |
import org.codehaus.groovy.ast.* | |
import org.codehaus.groovy.ast.expr.* | |
import org.codehaus.groovy.control.* | |
import org.codehaus.groovy.tools.GroovyClass | |
CompilationUnit compilationUnit = new CompilationUnit() |
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
def evaluator = new CachingEvaluator() | |
assert evaluator.evaluate("1 + 2 * 3") == 7 | |
assert evaluator.evaluate("1 + 2 * ${3}") == 7 | |
assert evaluator.evaluate(new String("1 + 2 * 3")) == 7 | |
assert evaluator.compiledScriptClasses.size() == 1 | |
class CachingEvaluator { | |
GroovyShell shell = new GroovyShell() |
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
// Bind 'out' variable to redirect script printing methods. | |
out = new StringWriter() | |
// Child script inherits our bindings, including 'out'. | |
// def result = evaluate(new File('TargetScript.groovy')) | |
def result = evaluate ''' | |
def a = 42 | |
println "The answer is $a." | |
a ** 2 | |
''' |