Skip to content

Instantly share code, notes, and snippets.

@andreiRS
andreiRS / zettelizer.js
Last active April 14, 2023 09:29
Extended the original zettelizer script to generate the zettels inside a folder with the same name as the source document. If you have also the plugin Zoottelkeeper installed, it will generate also an index file with the new notes. Example outcome: https://forum.obsidian.md/t/quickadd-plugin/20032/31
module.exports = async (params) => {
console.log("Starting...")
console.log(params);
const currentFile = params.app.workspace.getActiveFile();
if (!currentFile) {
new Notice("No active file.");
return;
}
console.log("Found active file: ", currentFile.basename);
@andreiRS
andreiRS / colors.css
Created March 4, 2021 10:34
A simple css snippet that extends the minimalist obsidian theme with custom colors for headers
/* colors of italics in Edit mode all notes in a vault */
.cm-em, em {
color: #ffb86c !important;
}
.cm-strong, strong {
color: #ff5555 !important;
}
/* headings for editor and preview */
@andreiRS
andreiRS / build.gradle
Created May 8, 2016 03:29
Execute system command from gradle
task hello(type: Exec) {
executable "sh"
args "-c", "echo 'hello from your shell'"
//store the output instead of printing to the console:
standardOutput = new ByteArrayOutputStream()
ext.output = {
return standardOutput.toString()
@andreiRS
andreiRS / build.gradle
Created May 1, 2016 16:57
Gradle task to print all local branches that contain a commit when CI uses detached head strategy
task printCommitBranches(type: Exec) {
executable "bash"
args "-c", "git branch --contains HEAD"
//store the output instead of printing to the console:
standardOutput = new ByteArrayOutputStream()
doLast {
// split the output of the git command per newline and remove indentation whitespaces
def outputLines = standardOutput.toString().split(/\r?\n\s+/)
// if detached head, remove the line
ln -s "/Applications/Sublime Text.app/Contents/SharedSupport/bin/subl" /usr/local/bin/sublime
@andreiRS
andreiRS / DOFTest.as
Created March 22, 2014 11:37
Away3d example how to use the "depth of field" filter/effect.
package {
import away3d.containers.View3D;
import away3d.debug.AwayStats;
import away3d.entities.Mesh;
import away3d.filters.DepthOfFieldFilter3D;
import away3d.lights.DirectionalLight;
import away3d.lights.PointLight;
import away3d.materials.ColorMaterial;
import away3d.materials.lightpickers.StaticLightPicker;
@andreiRS
andreiRS / Main.as
Created January 28, 2014 21:23
Away3D Simple Shadow
package {
import away3d.containers.ObjectContainer3D;
import away3d.containers.View3D;
import away3d.debug.AwayStats;
import away3d.entities.Mesh;
import away3d.lights.DirectionalLight;
import away3d.materials.ColorMaterial;
import away3d.materials.lightpickers.StaticLightPicker;
import away3d.materials.methods.SoftShadowMapMethod;
@andreiRS
andreiRS / gist:3602283
Created September 2, 2012 17:54
Small Timer Application
<?xml version="1.0" encoding="utf-8"?>
<s:WindowedApplication xmlns:fx="http://ns.adobe.com/mxml/2009"
xmlns:s="library://ns.adobe.com/flex/spark"
xmlns:mx="library://ns.adobe.com/flex/mx"
creationComplete="windowedapplication1_creationCompleteHandler(event)"
>
<fx:Script>
<![CDATA[
import mx.events.FlexEvent;
@andreiRS
andreiRS / CloneableVO.as
Created March 4, 2012 11:17
AS3 Object that can copy all properties(+recursive) from another object to himself
package com.rsurdu.utils
{
import flash.utils.Dictionary;
import flash.utils.describeType;
import flash.utils.getDefinitionByName;
import flash.utils.getQualifiedClassName;
import mx.utils.UIDUtil;
public class CloneableVO extends Object implements ICloneable