Skip to content

Instantly share code, notes, and snippets.

@gorbatova
gorbatova / widget.md
Created April 10, 2021 11:42 — forked from AlexxNB/widget.md
Howto make no-depends widget on Svelte and load it on the page

We should have at least three files: 'Widget.svelte', 'rollup.config.js' and 'package.json':

  1. Our widget Widget.svelte:
<script>
	export let name;
</script>

<h1>Hello {name}!</h1>
// Future versions of Hyper may add additional config options,
// which will not automatically be merged into this file.
// See https://hyper.is#cfg for all currently supported options.
module.exports = {
config: {
// choose either `'stable'` for receiving highly polished,
// or `'canary'` for less polished but more frequent updates
updateChannel: 'stable',
@gorbatova
gorbatova / gist:7f052b79a598a350c842c068517a203a
Created October 5, 2018 09:33 — forked from smartygo/gist:66cc07e6420e876546dc
Applying .gitignore to committed files
[command]
git ls-files -ci --exclude-standard
git ls-files -ci --exclude-standard -z | xargs -0 git rm --cached
[summary]
After editing .gitignore to match the ignored files, you can do
git ls-files -ci --exclude-standard
to see the files that are included in the exclude lists
You can then do
git ls-files -ci --exclude-standard -z | xargs -0 git rm --cached
@gorbatova
gorbatova / commit-msg
Last active October 31, 2023 22:43
Add timestamp and branch name to GIT commit message
# Step 1: Go to .git/hooks/ directory
# Step 2: Rename "commit-msg.sample" to "commit-msg" (CLI: mv commit-msg.sample commit-msg)
# Step 3: Replace the existing code in a "commit-msg" file with the following code
NAME=$(git branch | grep '*' | sed 's/* //')
TIMESTAMP=$(date +"%D %T")
DESCRIPTION=$(git config branch."$NAME".description)
echo "$TIMESTAMP — $NAME"': '$(cat "$1") > "$1"
if [ -n "$DESCRIPTION" ]
then
echo "" >> "$1"