Skip to content

Instantly share code, notes, and snippets.

@kyoncy
kyoncy / downloadBlocklyWorkspaceAsImage.ts
Last active December 8, 2023 08:55
Download Blockly.Workspace as SVG or PNG file
import Blockly from 'blockly';
declare interface CustomNode extends Node {
removeAttribute(arg0: string);
}
const DOMURL = window.URL || window.webkitURL;
const getSvgBlob = (workspace: Blockly.WorkspaceSvg) => {
const canvas = workspace.svgBlockCanvas_.cloneNode(true) as CustomNode;
@kohlerm
kohlerm / ConvexHull.inx
Last active March 20, 2024 17:10
convex hull plugin inkscape
<?xml version="1.0" encoding="UTF-8"?>
<inkscape-extension xmlns="http://www.inkscape.org/namespace/inkscape/extension">
<_name>ConvexHull</_name>
<id>org.simarilius.filter.ConvexHull</id>
<dependency type="executable" location="extensions">ConvexHull.py</dependency>
<dependency type="executable" location="extensions">inkex.py</dependency>
<effect needs-live-preview="false">
<object-type>all</object-type>
<effects-menu>
<submenu _name="Convex_Hull"/>
@chetan
chetan / db.rake
Last active July 12, 2022 19:18 — forked from e12e/db.rake
Rails rake tasks for dump & restore of PostgreSQL databases
# lib/tasks/db.rake
# Original source: https://gist.github.com/hopsoft/56ba6f55fe48ad7f8b90
# Merged with: https://gist.github.com/kofronpi/37130f5ed670465b1fe2d170f754f8c6
#
# This is the code from the comment:
# https://gist.github.com/hopsoft/56ba6f55fe48ad7f8b90#gistcomment-2275324
# Made into a fork/separate gist for easier download, with redundant shell-script removed.
#
#
# Usage:
@snrbrnjna
snrbrnjna / .htaccess
Last active May 10, 2022 01:56
Jekyll Auth Plugin - to manage http basic auth for jekyll generated pages and directories
#### Jekyll Layout: /_layouts/.htaccess
# Apache Configuration File
{% if ((page.auth_dir.users != empty) or (page.auth_dir.groups != empty)) %}
AuthName "Privater Bereich"
AuthType Basic
# => mehrere Require Blocks werden geodert: http://d43.me/blog/1157
AuthzUserAuthoritative Off
AuthUserFile {{ page.auth_remote_user_file }}
@hastern
hastern / wxUtilityDialog.py
Last active December 23, 2015 16:39
Some utility functions for wxPython dialogs.
#!/usr/bin/env python
# -*- coding:utf-8 -*-
import os
import wx
def messageDialog(message, caption=wx.MessageBoxCaptionStr, style=wx.OK | wx.ICON_INFORMATION):
"""Utility method to create a generic message dialog"""
dial = wx.MessageDialog(None, message, caption, style)
return dial.ShowModal()
@volkans80
volkans80 / EdgePan.js
Created January 2, 2013 13:16
Edge pan component for Isogenic Engine 1.1.0 Add it to viewport entity and use detectarea (pixels of edges), speed properties.
var EdgePan = IgeClass.extend({
classId: 'EdgePan',
componentId: 'edgepan',
init: function (entity, options) {
var self = this;
self._entity = entity;
self._options = options;
self.edgePanEntity = new IgeEntity()
.id('edgePanEntity')