Skip to content

Commit d77a01c

Browse files
stopsopahuggingface
andcommitted
test
Co-authored-by: huggingface <25720743+huggingface@users.noreply.github.com>
1 parent c775eaf commit d77a01c

5 files changed

Lines changed: 461 additions & 2 deletions

File tree

.agent/skills/ace-editor-web-component/SKILL.md

Lines changed: 61 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ Normally before we will be able to use this web component we will have to run
3333
<script
3434
type="module"
3535
src="https://stopsopa.github.io/ace-editor-webcomponent/ace-web-component.js"
36-
data-main-ace="https://cdnjs.cloudflare.com/ajax/libs/ace/1.43.3/ace.min.js"
36+
data-main-ace="https://stopsopa.github.io/ace-editor-webcomponent/noprettier/ace/ace-builds-1.43.4/src-min-noconflict/ace.js"
3737
></script>
3838
```
3939

@@ -71,3 +71,63 @@ def bubble_sort(arr):
7171
```
7272

7373
example above also demonstrate how we can change language of the editor programatically
74+
75+
# waiting to be able to interact with editor
76+
77+
if there is need to interact programatically with ace editor then below will not work.
78+
79+
<code>
80+
<ace-editor id="problematic-editor1">
81+
<script type="ace">
82+
// Initial function
83+
function greet(name) {
84+
console.log("Hello, " + name);
85+
}
86+
</script>
87+
</ace-editor>
88+
89+
<!-- and then in javascript -->
90+
91+
<script>
92+
{
93+
const editor = document.getElementById('problematic-editor1');
94+
95+
editor.value = editor.value + `
96+
console.log("Let's try to append this console.log");
97+
`;
98+
}
99+
</script>
100+
</code>
101+
102+
The reason is that this is web component and it have to by hydrated -> some scripts have to be loaded and logic aplied to "dress" the components to build them in the browser dom and make them ready to interact.
103+
104+
Therefore we have to have way to wait for it to happen, so this is how it can be done using onLoad event:
105+
106+
107+
<code>
108+
109+
<ace-editor id="problematic-editor2">
110+
<script type="ace">
111+
// Initial function
112+
function greet(name) {
113+
console.log("Hello, " + name);
114+
}
115+
</script>
116+
</ace-editor>
117+
118+
<!-- and then in javascript -->
119+
120+
<script>
121+
{
122+
const editor = document.getElementById("problematic-editor2");
123+
124+
editor.addEventListener("onLoad", () => {
125+
editor.value = `
126+
console.log("Let's try to append this console.log");
127+
`;
128+
});
129+
}
130+
</script>
131+
132+
133+
</code>

.agent/skills/bash-scripting/SKILL.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ But to be specific:
2525

2626
When you have to go up from current script location use ../ or ../../ but the general target is to reach root directory of the project and then from there somewhere else then define ROOT by rerriving it from DIR and from that point use ROOT to reach wherever you need to reach.
2727

28-
WARNING: if you have no intetnion to use ROOT in your script then don't define it at all.
28+
WARNING: if you have no intetnion to use DIR or ROOT in your script then don't define it at all.
2929

3030
# shebang
3131

0 commit comments

Comments
 (0)